#3959 - Cache warm up via Cron

Identifier #3959
Issue type Feature request or suggestion
Title Cache warm up via Cron
Status Open
Tags

Type: Performance (custom)

Handling member Deleted
Addon core
Description Initial installs may seem slow because initial caches are not populated.
Additionally, future use may seem slow if some resource is accessed but the cache is expired.

These caches could easily be populated in the background (in this priority order):
- Language file cache
- Template cache
- Comcode page cache
- Blocks (by fully evaluating Comcode page URLs under different access permissions and other common cachable things like mobile vs desktop)
- this may need more thought, as if we can somehow autodetect exactly what permutations to do, and how frequently, that would be better
- Static cache (for anything on the Sitemap accessible to guests)
(pre-shipping compiled caches is not realistic as caches are environment-specific)
Detection of cache expiry should be biased for things expiring soon - so that we can make sure when a real user hits them that user's web request won't be responsible for doing the regeneration.

Special considerations:
- "ignore_user_abort(true);" will need calling, so the AJAX requests keep going after the user navigates away.
- We should use locking, only 1 background cache request at a time
- But it needs to be smarter locking (in case of thread termination): update the lock timestamp very frequently, and ignore stale locks

This depends on #3501 - with AJAX activated Cron it would build these caches before even proper Cron was set up. It would be low priority.
It also depends on #3958 - we would not want to be doing extra work in Cron if we do not know it is only happening under low load. (It could be wasted effort - the cache might get emptied too soon for it to be worthwhile)
Steps to reproduce

Related to

#3501 - Poor-mans-Cron

#3958 - Opportunistic scheduler

Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated