Caching Overview
Peakhour's cache and delivery controls store eligible responses close to users and reduce repeated origin work. Static assets such as images, videos, and HTML pages can be cached across Peakhour's delivery path, improving load time and reliability, especially for users who are geographically far from the origin server.
Explanation of phases¶
Each cache phase helps determine whether a request can be served from cache, should be fetched from origin, or needs response handling before it reaches the user. These phases include:
-
On Request: This phase involves checking the request from the user to determine whether the content can be cached and if any specific rules apply.
-
On Response: This phase involves setting the cache policy for the browser and optimising the response before it is delivered to the user.
-
On Origin Request: This phase involves checking the origin server's response to determine if the content can be cached and if any specific rules apply.
-
On Origin Response: This phase involves storing the response from the origin server in the cache, setting the time-to-live (TTL) for the cached content, and optimising the response before it is delivered to the user.
Use Cases¶
Peakhour caching can be used to improve the performance and reliability of a website, especially for users who are geographically far from the origin server. The various settings and options available in each phase allow the website owner to customise the delivery of content to the user, ensuring that the user gets the best possible experience. For example, the Serve Stale option in the On Origin Request phase allows Peakhour to continue to serve stale cached content if the origin server is unavailable. This helps ensure that the user always has access to the content, even if the origin server is down.
Conclusion¶
In conclusion, Peakhour's cache and delivery controls are valuable tools for website owners who want to improve the performance and reliability of their website. The various phases and settings allow the website owner to customise delivery to the user, ensuring that the user gets the best possible experience. Whether you need to cache dynamic content for logged-in users or require a minimum cache time for your content, Peakhour provides the controls to manage it.