• Resolved vicdahl

    (@vicdahl)


    Hello!

    I have configured W3 total cache to preload pages, but they do not seem to be saved in the cache. By looking in the web server log (see below) after triggering the wp_cron I have found out that the sitemap.xml is loaded by the web server and five pages then are requested by W3 Total Cache. However, counting the files in /wp-content/w3tc/pgcache before and after this session both results in 27, and loading the listed pages are just as slow as loading any not yet cached page. The saving of a page cache works when a real web browser hits the page; the number of files increases by one and next hit to that page is fast.

    Has anyone experienced a similar problem? Any ideas for a solution?

    400.0.0.2 - - [13/Aug/2011:20:35:55 +0200] "GET /wp-cron.php?doing_wp_cron HTTP/1.1" 200 2 "-" "Opera/9.80 (X11; Linux i686; U; en-GB) Presto/2.9.168 Version/11.50"
    300.0.0.1 - - [13/Aug/2011:20:40:55 +0200] "GET /sitemap.xml HTTP/1.1" 200 12679 "-" "W3 Total Cache/0.9.2.3"
    300.0.0.1 - - [13/Aug/2011:20:40:56 +0200] "POST /wp-cron.php?doing_wp_cron HTTP/1.0" 200 2 "-" "WordPress/3.2.1; http://krischan.se"
    300.0.0.1 - - [13/Aug/2011:20:40:55 +0200] "GET /nationen/stipendier HTTP/1.1" 200 36561 "-" "W3 Total Cache/0.9.2.3"
    300.0.0.1 - - [13/Aug/2011:20:41:04 +0200] "GET /aktuellt/fotogalleri HTTP/1.1" 200 35878 "-" "W3 Total Cache/0.9.2.3"
    300.0.0.1 - - [13/Aug/2011:20:41:07 +0200] "GET /nationen/stadgar HTTP/1.1" 200 54306 "-" "W3 Total Cache/0.9.2.3"
    300.0.0.1 - - [13/Aug/2011:20:41:10 +0200] "GET /kontakt/marknadsforing HTTP/1.1" 200 37033 "-" "W3 Total Cache/0.9.2.3"
    300.0.0.1 - - [13/Aug/2011:20:41:13 +0200] "GET /huset/bostadsansokan HTTP/1.1" 200 35696 "-" "W3 Total Cache/0.9.2.3"

    http://wordpress.org/extend/plugins/w3-total-cache/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter vicdahl

    (@vicdahl)

    I have found out that the saving of the pages works after replacing w3_http_get with file_get_contents in /wp-content/plugins/w3-total-cache/lib/W3/Plugin/PgCache.php on line 378:

    /**
     * Make HTTP requests and prime cache
     */
    foreach ($queue as $url) {
        //w3_http_get($url);
        file_get_contents($url);
    }

    This solution works for me, but I don’t think it’s good to make changes to plugins as it will be reverted after update. Also, I suppose that the plugin’s function in some way is better than PHP’s internal, since otherwise it would be unnecessary.

    I can’t see any differences in the requests in the web server log, apart from another user agent. I think it seems unlikely that the user agent makes the difference, but I don’t know what does.

    Yep, that was my experience too…”Automatically prime the page cache” does not seem to work in spite of having a compliant sitemap.xml…

    I’d previously posted about this issue also. I’ll give your workaround at try – though if its really a code bug it should affect everyone – must not be too many folks using the Prime Cache option given that there has only be a few posts about it.

    @toynn

    in the link you provided, someone had come up with a mod… are you not using that?

    If you are still having cron sitemap problem could you be so kind to send a bug submission form from the Support page inside the plugin?

    Thread Starter vicdahl

    (@vicdahl)

    @andreas Nurbo

    I’m still using version 0.9.2.3 with my modification above, now with wordpress 3.3.1, and I think it’s working well. Some months ago when 0.9.2.4 was released I tried to update w3 total cache, but then the cache preload was even worse as it did not even try to load the pages according to the web server log.

    Since the cache preload parts of w3 total cache seem to have changed a lot between 0.9.2.3 and 0.9.2.4 I’m not sure a bug report from 0.9.2.3 would be useful. It would be nice to be able to update to the latest version though, so if you think it can be fixed I can try to submit a bug report, either from version 0.9.2.3 or after trying to update to 0.9.2.4 again.

    @vicdahl @andreas nurbo

    I agree with vicdahl, the function in 0.9.2.3 does work and stop functioning in 0.9.2.4

    For me this worked and solved the problem.

    Let me know if you need any help!

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    This is fixed in the next release.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: W3 Total Cache] Preloading page cache does not save pages’ is closed to new replies.