wp-pjax icon indicating copy to clipboard operation
wp-pjax copied to clipboard

Scheduling crons at 300 sec ( less than 15 min ) is prohibited

Open eimanavicius opened this issue 10 years ago • 2 comments

phpcs: WordPress.VIP.CronInterval.cron_schedules_interval: Scheduling crons at 300 sec ( less than 15 min ) is prohibited. https://github.com/pelmered/wp-pjax/blob/b9f4abfc38a768b7b17fe392d89fd59c2efb99e3/inc/PageCachePrefetch.php#L33 https://github.com/pelmered/wp-pjax/blob/b9f4abfc38a768b7b17fe392d89fd59c2efb99e3/inc/PageCachePrefetch.php#L47-L60

eimanavicius avatar Mar 31 '16 12:03 eimanavicius

Why this was scheduled so often? Maybe it should be turned to config value?

eimanavicius avatar Apr 01 '16 05:04 eimanavicius

This code is a bot beta, as you probably can see, but I'm pretty sure it worked when it was written in 2013. I think the idea was to prefetch a smal chunk of all the URL's every 5 min. You don't want to fetch all the URL's in one go on a big site. For example if you want to prefetch every URL every 24h on a site with 5000 URLs the script would refresh 18 URLs every 5 min.

We probably need to rethink this a little and of course this should be configurable.

pelmered avatar Apr 01 '16 08:04 pelmered