We just covered some of the benefits of browser caching, but taking that another step further, another way to get the best performance out of your site is to leverage proxy caching. Like browser caching, proxy caching works by utilizing proxy servers to store cached copies of content from your origin server. However, unlike browser caching, which can be modified or controlled by the user, proxy caching is controlled and managed by the CDN (Content Delivery Network) service provider.
Leverage Proxy Caching (Deprecated)
What is Proxy Caching?
How Does Proxy Caching Work?
Deciding on whether the cached content needs to be served versus new content is set by the cache-control headers. These are a few of the different cache-control headers that are used:
- No-cache. This header tells the server that it should not send any cached content or objects from the server.
- Max-age. This header compares the cached content or resources to its age. If the content is less than the max-age, then the cached content can be used.
- Min-fresh. This header is used to tell the browser/client that it wants content that is within a certain “freshness” threshold. Its expiration can be no less than its current age, plus the specified time (in seconds).
- Max-stale. This header sent from the client tells the server that it will accept objects, if they are not too “old.” This is typically used in situations where browsers will display content, even if network or Internet connections are poor, instead of serving up nothing to the user.
It is important to review these headers to ensure that your web pages are set up to handle different user and client/browser situations.
Benefits of Proxy Caching
One of the benefits of proxy servers is that they can be used to deliver website resources, or objects, which can be documents, images, and text, to users located in different geographic regions, rather than relying solely on your origin server. In turn, this provides for quick page load times, less latency, and better overall visitor experience. This works only after the first visit. On the initial visit, the origin server delivers the content to the user. On subsequent visits, the proxy server is utilized to deliver the content to the user. Proxy caching, used in conjunction with browser caching, can be a fantastic way to ensure website performance. Proxy caching can also assist with delivering dynamic content or more complex applications in a more efficient manner.
Lighthouse is an open-source tool that is used to run an audit against your web pages and provides scores and suggestions for improving page performance, accessibility, SEO, and more.
PageSpeed Insights is a tool created by Google that reports on the performance of a page on both mobile and desktop devices, and provides suggestions on how that page may be improved.