Fix wpo_last_page_cache_preload timestamp
-
I would modify the file ‘class-wp-optimize-page-cache-preloader.php’ in order to increase the default value of the constant ‘allowed_time_difference’ since 10 minutes is not enough… let me explain.
If I check the lifespan to a certain value and then check the preload scheduler equal to the lifespan and if the preload time is higher than 10 minutes, then, the next execution of the event ‘wpo_page_cache_schedule_preload’ in the scheduler will check the ‘time_since_last_preload’ and compare with the ‘$page_cache_lifespan – $allowed_time_difference’ and it will happen that ‘time_since_last_preload’ will be always lower than ‘$page_cache_lifespan – $allowed_time_difference’ if preload execution time is highet than ‘allowed_time_difference’ so it will skip preload one every two executions.
I don’t know if I explained myself properly, but after many checks on my website, I had to manually increase ‘allowed_time_difference’ because the preload in my website takes almost 20 minutes to be complete.
Other better solution should be to mark the ‘wpo_last_page_cache_preload’ field on the database with the start time of the preload instead of the end time of the preload. In this case the issue detailed abover will not happen.
The topic ‘Fix wpo_last_page_cache_preload timestamp’ is closed to new replies.