How caching works on the platform
Four caches sit between a visitor and your database. Knowing which is which explains most surprises.
Caching is why a managed site answers in tens of milliseconds. It is also why an edit sometimes seems not to appear. These are the layers, in the order a request meets them.
The layers
| Layer | Holds | Cleared by |
|---|---|---|
| Browser cache | Static assets on the visitor's device | The visitor, or a new file name |
| Edge cache | Images, CSS and JavaScript at the CDN | Purge from the dashboard |
| Full-page cache | Rendered HTML | Publishing a post, or a purge |
| Object cache | Query results and transients, in Redis | Flushing the object cache |
| OPcache | Compiled PHP | Deploying code, or a PHP restart |
What is never cached
- Requests from logged-in users.
- Cart, checkout and account pages.
- Anything with a query string that is not on the allow-list.
POSTrequests, so forms always reach PHP.
Automatic purging
Publishing or updating a post clears the page it produces, the archives it appears in and the home page. A full purge is rarely necessary.
