• We are unable to get page cache priming to generate any pages in the cache. We are using Disk: Basic.

    We have priming set to run every 10 minutes and generate 10 pages. We confirmed that we were having issues with wp-cron running on our staging server so we disabled automatic wp cron and have been manually firing it by hitting somedomain.com/wp-cron.php – which works: the cron queue is properly cleared when this runs (based on Advanced Cron Manager). However the page cache never gets anything in it.

    We confirmed the sitemap we are using is good (our test only has 6 URLs in it), including validating it using the link in the W3TC plugin admin. The sitemap was generated by Yoast. We are not using the sitemap index but one of the individual sitemaps referenced in the index.

    We installed wp-cli and called “wp w3-total-cache pgcache_prime”. This returned “Success: PageCache Priming triggered successfully.” – however no pages were cached.

    If we visit the pages directly (via the links in the sitemap or regular site navigation) they ARE cached.

    We also tried manually triggering caching of a specific page via the code suggested in this post: https://www.ads-software.com/support/topic/flush-cache-for-specific-page/ but it didn’t work either. This page wasn’t in the sitemap so not sure if that would have an effect or not.

    We’re at a bit of a loss. It seems like either it doesn’t like the sitemap, or W3TC is failing to run cache priming after it is triggered.

    Any suggestions?

Viewing 4 replies - 1 through 4 (of 4 total)
  • bgdstr

    (@bogdanstratulat)

    Please note that W3TC is using wp_remote_request function, which uses either fsockopen or curl. You might have issues with one of those, so you should check if a manual wp_remote_request to one of the pages works. I hope this helps.

    Thread Starter metricmedia

    (@metricmedia)

    Yes indeed – that was definitely a problem. Fixed that (internal DNS issue) and now it is working!

    Can you confirm that cache priming won’t work off a sitemap index (such as Yoast generates)? If so is there a sitemap generation tool that you would recommend?

    bgdstr

    (@bogdanstratulat)

    You may want to check :

    https://kb.yoast.com/kb/xml-sitemap-errors/

    I hope this helps.

    Thread Starter metricmedia

    (@metricmedia)

    According to W3TC support, priming works with plain sitemaps only, not sitemap indexes. Although it’s strange – I am testing with a Yoast sitemap index now and _some_ pages are getting primed. It seems to have stalled after about 18 pages though.

    I think we’re just going to go with a manual approach – query the categories of posts we need and pass them to a custom function we created to purge and prime each page individually, and run that whole process off server cron:

    function prime_w3tc_page($url)
    {
    	$w3_pgcache = \W3TC\Dispatcher::component( 'CacheFlush' );
    	$w3_pgcache-> flush_url($url);
    	$r = wp_remote_request($url);
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Page cache priming not working’ is closed to new replies.