About caching
Caching is a common technique used to store copies of frequently used information in a temporary storage location or cache to serve requests more quickly.
It can be applied at various levels, such as Squiz Content Management and content delivery networks (CDNs).
Why is caching important?
By storing frequently accessed data close to the user, caching reduces the time it takes to retrieve and display content, leading to faster page load times. Cached data can be delivered faster than fetching fresh data from the original source, reducing latency and improving user experience.
Users can also benefit from consistently faster loading times, which can lead to higher satisfaction and increased engagement. In some cases, caching allows content to be available offline, or accessible during low-connectivity situations.
Caching core concepts
Concept | Description |
---|---|
MAX-AGE |
Part of the |
HIT |
A response was served directly from the cache, and it has been in the cache for less than the There was no attempt to contact the origin server. |
MISS |
There was no object in the cache for this request, and a request to the origin was made. |
STALE |
A cache object is considered stale if it exists in the cache and has been there for longer than the |
STALE-WHILE-REVALIDATE (SWR) |
Part of the Should a stale object be served during this window, a request to the origin is made in the background, which will replace (refresh) the cache object. |
STALE-IF-ERROR |
Part of the Indicates for how long a request can be satisfied with a stale cache object when the origin is erroring. |
POINT OF PRESENCE (PoP) |
In Cloudflare (CF), a PoP is a physical server location within a Cloudflare data center. Each PoP has its own cache. Because of this, you will see different age values for a given resource, depending on which PoP you are accessing. You can see which PoP you are accessing in the |