WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
Preloaded pages not created until user visits (41 posts)

  1. cole20444
    Member
    Posted 2 years ago #

    Hey, looking for some help and possibly clarification. My understanding is that preload mode will generate cached pages ahead of time so the pages don't have to be generated when the user visits the page. What currently is happening is that when i click "Preload Cache Now" the pages are generated and then deleted. At the end of the process i end up with only the homepage's index.html and index.html.gz.

    I'm able to tell this because i'm monitoring the contents of the supercache directory while the preloading process is happening. The pages are only created, and not deleted, when an anonymous user visits them.

    My question is: Is this what's supposed to be happening? If not why is Super Cache deleting the cached pages right after they're created?

    Thanks in advance!

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    No, that's not supposed to happen. Can you use the debug system in the plugin? That will tell you what's happening.

  3. cole20444
    Member
    Posted 2 years ago #

    Hey,
    Thanks for the quick response. I did use the debug tool beforehand to see if i could identify the problem. Unfortunately i didn't see anything alarming. Below is a link to the debug file.

    http://preview.glg.com/wpsupercache-debug.txt

    Thanks

  4. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    I noticed that our-companies page was cached and then promptly deleted by the cron job. Make sure you have "preload mode" switched on and check the garbage collection settings in the advanced settings page.

  5. cole20444
    Member
    Posted 2 years ago #

    Yeah that's what i'm baffled about. I'm not understanding why the garbage collection runs every time these files are created. Here's links to images of my advanced and preload settings. Also, i believe there was an update to the Super Cache plugin recently (i'm thinking in the past couple days), and i don't remember this issue ever occurring before. Not sure if it's relevant but i thought i would mention it. Is there a link to the previous build so i could test with that version?

    http://preview.glg.com/advanced.png
    http://preview.glg.com/preload.png

  6. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    Yeah, check this this link for previous versions.

  7. cole20444
    Member
    Posted 2 years ago #

    So reverting to the previous version fixed the issue. I also reinstalled the newest version and used the default settings and tried again just to see if my settings were whack and the problem still persisted. There must be some garbage collection bug in the newest version.

    Thanks for you help

  8. bradenmikael
    Member
    Posted 2 years ago #

    Obviously, I'm not the only one having this issue. Weird.

  9. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    bradenmikael, cole20444 - have you tried the development version? You can download it on this page and I think preload should work with that version.

  10. bradenmikael
    Member
    Posted 2 years ago #

    Development version yields same results. No dice.

  11. bradenmikael
    Member
    Posted 2 years ago #

    On a side note, now the development version shows nothing but a white screen when you go to the super cache settings panel. Grrrr ...

  12. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    Check your PHP error log. Anything there? uncomment the error_reporting() line at the top of wp-cache-phase1.php and reload the page - it may show something then.

  13. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    I've added a lot of debugging to the preload process and run it several times without a hitch.

    Can you download the development version again (if you're brave enough) and enable debugging? You can probably limit the debugging to the IP of your server (ping your own hostname to find it) then preload the smallest number of posts you can so the garbage collection runs at the end.

  14. damaha
    Member
    Posted 2 years ago #

    Hi Donncha, I have the same problem with preloading the cache. I'm quite sure it worked fine in the past, but probably after updating to wordpress 3.3 or updating the wp cache plugin problems started. I did not change any settings.

    After I press "preload cache" the cache is preloaded; when I click on the link "Regenerate cache stats" I can see that the number of cached files is increasing. But when the preloading process is finished and all files should be cached, it seems that all files are being deleted.

    The following code is an excerpt from the debugging file:

    13:48:36 /gold-blog/ Sending buffer to browser
    13:48:36 /gold-blog/ wp_cache_shutdown_callback: collecting meta data.
    13:48:37 /wp-cron.php?doing_wp_cron=1325771251 supercache dir: /[...]/wp-content/cache/supercache/www.trustablegold.com/
    [...]
    13:48:37 /wp-cron.php?doing_wp_cron=1325771251 gc: deleted /[...]/wp-content/cache/supercache/www.trustablegold.com/2012/gold-2012

    Obviously, after building up the cache, every single file in the cache is being deleted via a cron job??

    Any idea? Thanks in advance.

  15. damaha
    Member
    Posted 2 years ago #

    p.s.: Garbage collection is disabled:

    In "Expiry Time & Garbage Collection" Cache Timeout is set to 0 seconds.

  16. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    Try the development version linked above!

  17. bradenmikael
    Member
    Posted 2 years ago #

    I deleted all traces of the plugin and installed the current v1.0 release. Super Cache is fully functional, including preload. I don't know what made it not work before.

  18. cole20444
    Member
    Posted 2 years ago #

    Sorry still the same for me. Had the same issues with the dev version as the others and then i updated to the latest when bradenmikael said it was working, but it still deletes the files right after they're created

  19. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    cole20444 - While using the latest development version can you use the debug system and post the output of the end of the debug? (from just before everything gets deleted)

    Have you got WordPress installed in a folder or anything unusual beyond the bog standard "install it where it runs" setup?

  20. bradenmikael
    Member
    Posted 2 years ago #

    The latest release version continues to work perfectly for me. Cole, what you might want to do is remove the super cache, and reinstall the latest release, v1.0.

    Also, check to make sure garbage collection is turned off. Turn on preload, set it to load all of your site. Click on the preload button, and sit back for a few minutes.

    Check the cache stats folder and refresh it periodically to see if the file number is growing.

    If all else fails, you could try the crazy cache plugin which will work alongside super cache and it will do the preloading for you. I tested it on my WordPress test VM along with Super Cache v.1 and I can confirm it works quite well.

  21. erick_paper
    Member
    Posted 2 years ago #

    Latest WP 3.3.1 and latest Super Cache as on the WP site.

    Preload not working on any of my sites. Just doesn't pre-cache anything.

    Supercache in general is working splendidly.

  22. Joe Siegler
    Member
    Posted 2 years ago #

    I'm with the others - preload isn't working for me, either.

    I've tried the development version, no difference. Might have to try that crazy cache thing, as I'm launching today and I need to have my cache pre-loaded, due to the crush I'm gonna get.

  23. Joe Siegler
    Member
    Posted 2 years ago #

    Tried it again. I totally removed what I had on my site, followed all instructions, and then reinstalled from scratch with the development version.

    No change. Nothing gets built in the preload. Have it set to email me too, and I've never seen an email.

  24. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    Joe - there are plugins for checking the wp cron queue. Might be worth a shot. Also try using debugging in Supercache.

  25. Console Prices
    Member
    Posted 2 years ago #

    Same thing happened for me too. Reverted to the previous version and that works fine.

  26. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    If one of you can give me access to your server - WordPress and ftp/ssh I can debug this. I can't replicate this and very little changed in the preload system between versions.

    Email me at donncha at ocaoimh.ie please!

  27. te-deum
    Member
    Posted 2 years ago #

    hello @ll,

    I have found why the error occur ! It's due to post order. If a child page is generated before his parent then parent will delete all childs while he is generated. (Excuse me if you don't understand... I'm not english)

    The solution is to re-order page Ids in order to cache parents before childs. I have changed line 2745 in wp-cache.php from :

    $posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE ( post_type != 'revision' AND post_type != 'nav_menu_item' ) AND post_status = 'publish' ORDER BY post_date DESC LIMIT $c, 100" );

    to :

    $posts_id = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE ( post_type != 'revision' AND post_type != 'nav_menu_item' ) AND post_status = 'publish' ORDER BY post_date DESC LIMIT $c, 100" );
    $posts_tmp = array();
    $posts = array();
    foreach( $posts_id as $post_id )
    	$posts_tmp[ $post_id ] = get_current_url_supercache_dir( $post_id );
    asort( $posts_tmp );
    foreach( $posts_tmp as $post_id => $post_url )
    	$posts[$post_id] = $post_id;

    I hope that this will help everybody.

  28. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    te-deum - thanks, that could be it! Also, in 0.9.9.9 the preload didn't select pages so if you have a page as your front page it wouldn't have preloaded it.

  29. te-deum
    Member
    Posted 2 years ago #

    Since I apply this modification, I don't have this issue anymore ;-)

    I think that the problem could appear on large website with a lot of posts. If some childs are preloaded before their parents in another group of preloaded pages.
    It may be possible to have a better way to not delete preloaded pages inside 'prune_super_cache' (function that delete pre-loaded child pages).

    I have noticed that pages as homepage doesn't preload... So the bug appear (not always :-s) and the pre-loaded pages are deleted while the homepage is cached.

    Thank you to you for all you have done with this great plugin !

  30. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    I think I've fixed that "the pre-loaded pages are deleted while the homepage is cached" problem in trunk and the dev version will update in the next 20 minutes.

    You can also grab the updated wp-cache.php and put it in your wp-content/plugins/wp-super-cache/ folder if you already have the dev version (a recent one that is!)

    I changed the select to ORDER BY ID ASC and check for the front page blog options. If they're set then the preloader skips those pages.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic