• Resolved Henk Barreveld

    (@henk-barreveld)


    Hello,

    I have set up WP-Optimize with

    • page cache enabled
    • cache separate files for mobile devices
    • cache lifespan 8 hours
    • scheduled cache preloading activated, time period “same as cache lifespan”

    So I expected that cache preloading would run every 8 hours, but it seems that is not the case. From the website access logfiles it seems to be clear that preloading runs only every 16 hours.

    At least, about every 16 hours I see for a whole lot of applicable posts and pages two GET requests coming from the website IP address, immediately after each other, one with “(Macintosh; Intel Mac OS X 10_12_6)” and the other with “(iPhone; CPU iPhone OS 9_1 like Mac OS X)”.

    Do I misunderstand how the preloading works?

    Best regards,
    Henk

Viewing 4 replies - 1 through 4 (of 4 total)
  • @henk-barreveld Can you please try to Wipe settings from WP-Optimize > Settings and then re-configure the Preload settings and check if the Preload works at the specified time?

    Thread Starter Henk Barreveld

    (@henk-barreveld)

    Hi @bornforphp,

    Last Tuesday I did as you recommended and I just verified the results, looking in the raw access logs for sitemap.xml GET requests, coming from the website IP address.

    The result is that cache preload started:
    – Mar 16, 23.38h
    – Mar 17, 07.39h
    – Mar 17, 15.39h
    – Mar 17, 23.39h
    – Mar 18, 07.41h

    Perfect, every 8 hours; problem solved. Thank you!

    Does this mean that I always have to wipe all settings and reconfigure when I want to change the preload frequency?

    Best regards,
    Henk

    Thread Starter Henk Barreveld

    (@henk-barreveld)

    Hi @bornforphp,

    I am afraid I have to come back on my previous, positive reply. Wiping the settings from WP-Optimize > Settings and then re-configure the Preload did not solve the preload schedule problem, after all.

    When I reset the WPO settings, I also reduced the number of pages/posts to be preloaded (by changing the wp-sitemap.xml settings) because I thought that would be better for testing. After I set this back to the original wp-sitemap.xml settings, the problem returned: cache lifespan setting 8 hours; preload frequency setting the same as cache lifetime, but the actual preload frequency is once per 16 hours.

    I looked into the plugin source code and I think I understand why this is happening. When a preload is started, class WP_Optimize_Page_Cache_Preloader verifies if the previous preload is stale, by comparing preload completion time with current time. Doing so, it assumes that the preload has not taken more than 600 seconds. In my case that is just a little too low.

    In my functions.php file I have now added a filter for the hook ‘wpo_preload_allowed_time_difference’ that sets the maximum preload duration to 1200 seconds, which should be more than enough. I will let you know whether this solved the problem.

    Best regards,
    Henk

    Thread Starter Henk Barreveld

    (@henk-barreveld)

    Hi!

    When cleaning up my email inbox I noticed that I had still not followed up on this issue, as I had promised.

    It is my pleasure to let you know that the analysis and solution from my previous message seems to be correct. So if anybody would have problems in the future with scheduled preloads being missed, you can tell them that they should increase the allowed time for preloading, by adding the described code to their functions.php file (or so).

    Best regards,
    Henk

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘unexpected preload frequency’ is closed to new replies.