WordPress.org

Support

Support » Plugins and Hacks » WP Super Cache » [Plugin: WP Super Cache] Preloaded pages not created until user visits

[Plugin: WP Super Cache] Preloaded pages not created until user visits

  • 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/

Viewing 15 replies - 16 through 30 (of 40 total)
  • 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.

    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

    Plugin Author Donncha O Caoimh

    @donncha

    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?

    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.

    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.

    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.

    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.

    Plugin Author Donncha O Caoimh

    @donncha

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

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

    Plugin Author Donncha O Caoimh

    @donncha

    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!

    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.

    Plugin Author Donncha O Caoimh

    @donncha

    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.

    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 !

    Plugin Author Donncha O Caoimh

    @donncha

    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.

    The Dev version is working for me.
    Thank you for your reactivity !!

    Regards.

Viewing 15 replies - 16 through 30 (of 40 total)
  • The topic ‘[Plugin: WP Super Cache] Preloaded pages not created until user visits’ is closed to new replies.
Skip to toolbar