Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smichaelsen/typo3-page-warmup
https://github.com/smichaelsen/typo3-page-warmup
Last synced: 30 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/smichaelsen/typo3-page-warmup
- Owner: smichaelsen
- Created: 2022-06-10T13:25:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-18T08:29:05.000Z (about 1 year ago)
- Last Synced: 2024-09-21T11:54:37.274Z (3 months ago)
- Language: PHP
- Size: 97.7 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Page Warmup
## Cache warmer for your TYPO3 pages ☕️
When content is edited in TYPO3, caches for certain pages are flushed automatically. Depending on your setup that can be dozens of pages with news plugins that are flushed when a news record is
edited, for example.This extension detects URLs of pages that have fallen out of the cache and provides a scheduler task to warm them up automatically, before your visitors have to do it.
## Installation
`composer require smic/page-warmup`
## Usage
After installing the extension, set up a new scheduler task with the class "Page Cache Warmup Queue Worker (page_warmup)". The recommended (conservative) setup is:
* Type: Recurring
* Frequency: 120
* Don't Allow Parallel Execution
* Time limit in seconds: 60That's it. Whenever the caching framework flushes page caches based on cache tags, the affected pages will automatically get warmed up again.
![Scheduler Task](doc/scheduler.png?raw=true "Scheduler Task")
If the cache warmup is too slow, you can try a more aggressive setup like:
* Type: Recurring
* Frequency: 60
* Allow Parallel Execution
* Time limit in seconds: 240That will result in ~ 4 simultaneous task processes, that are working on the queue. That means increased load on your system.
## Under the hood
In the TYPO3 caching framework entries are flushed by tags or all at once, and it gives you no feedback about what content / information has actually been flushed - that makes it hard to know what
needs warming up. That's why this extension collects that information when a page is cached. It remembers the URLs and cache tags in a so called _warmup reservation_. When a cache tag is flushed, the
extension can pull up all reservations matching that tag, and write the page URLs to a warmup queue.### Detecting when a page is cached
TYPO3 doesn't have a suitable hook or middleware to react to pages being cached, so this Extension provides a cache `VariableFrontendWithWarmupReservation` and registers it for the `pages` cache. It
takes a look at all incoming cache entries and what _looks_ like the cache entry for a page, will be written into a warmup reservation.