Opened 7 years ago
Closed 7 years ago
#43103 closed defect (bug) (fixed)
Reduce Plugin/theme API calls during core release windows
Reported by: | dd32 | Owned by: | dd32 |
---|---|---|---|
Milestone: | 4.9.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Upgrade/Install | Keywords: | fixed-major |
Focuses: | Cc: |
Description
During WordPress security release windows we reduce the API TTL to cause WordPress to check for updates more often. This allows us to roll out security patches in a shorter timeframe (instead of over ~12-24hrs).
One unfortunately side effect of having the core check run more often, is that it triggers both the plugin and theme update checks to occur as well. This isn't normally an issue, however the plugin & theme update checks are relatively heavy calls which we can't simply cache, combine that with sites checking in every ~hour and WordPress.org's load increases dramatically.
This happens as we trigger an auto-update attempt after each core update check, which then causes a plugin and theme update check to trigger (as they have their caches disabled during cron requests) as they're also part of auto-updates.
The attached patch attempts to do two things:
- When checking for core updates, only trigger auto-updates if one actually exists and can be updated to. This is separate from the twice-daily auto-update cron task.
- Increases the cache timeout for plugins and themes in cron from 0 seconds to 2 hours.
I don't know how much (if any) impact 2.
will have, however I don't think it'll cause any noticeable issues, and re-using a cache from the last 2 hours on a twice-daily cron seems entirely reasonable to me. The only reason cron has a lower cache timeout is that it's not as much of an issue if the request is slow, as it's running non-interactively.
In 42584: