What is a Cached Page?
A cached page is a copy of a webpage stored in a different location from the original. This storage location is called a cache, and the stored copy is referred to as the cached page.
Multiple platforms and systems, including search engines, browsers, and content delivery networks (CDNs), can cache pages. However, the intent and storage location of the cached page can differ depending on the platform.
Importance of a Cached Page
Caching allows visitors to access webpages faster than they usually would. This means visitors enjoy quicker page load speeds. These swift page load speeds then lead to secondary benefits like an improved user experience, reduced bounce rates, and better SEO rankings.
Caching also reduces the origin server’s workload and saves its bandwidth since it does not have to send back and forth HTTP requests and responses to browsers that want to access the webpage. Instead, the browser will load the webpage from a cache.
In certain instances, as in the case of a content delivery network (CDN) cache, the browser may not even contact the origin server at all and will instead send requests directly to the CDN server. The CDN server then handles the browser’s request without bothering the origin server.
Caching also allows visitors to access a webpage even when the origin server is down and inaccessible. They are also helpful during traffic spikes as they reduce the chances of the origin server getting overloaded with requests.
Lastly, while this is a niche benefit, caches allow visitors to access previous versions of a webpage. This is important for research and documentation purposes, particularly when the original content is no longer available or has been updated such that it no longer reflects the previous information.
Types of Caches
A cache is the location where a cached page is stored. There are multiple types of caches, including:
- Browser cache
- Content delivery network (CDN) cache
- Domain name server (DNS) cache
- Service worker cache
- Application cache
- Gateway cache
- Proxy cache
Each cache improves the page speed. However, they either work on specific parts of the webpage or only store specific elements from the webpage. Nonetheless, the most common caches you will encounter while browsing the web are the browser and content delivery network (CDN) caches.
1 Browser Cache
The browser cache allows the browser to save a copy of the webpage on the user’s device. So, when the user wants to revisit the webpage, their browser sends an HTTP request to the server requesting the page.
The server then returns a 304 Not Modified HTTP status code, indicating the webpage has not been modified since the browser’s last visit. The server will not resend the webpage. Instead, it requires the browser to show the visitor the cached page stored on their device.
Without the browser cache, the browser would have to re-download the webpage from the server, which would consume the browser and server’s resources and increase the page load time.
However, with the cache, the server consumes less bandwidth and lowers the hosting cost for the blogger. This also improves the user experience for visitors as they can access webpages quickly than they usually would. Some visitors may even experience a near-instant page load in certain instances.
2 Content Delivery Network (CDN) Cache
Content delivery networks (CDNs) store content on ‘edge servers,’ which are servers located close to the visitor. When a visitor requests a webpage, the content delivery network serves the content from the nearest edge server.
This reduces latency and page load times. The origin server also saves its bandwidth and resources since the browser does not typically contact it during the connection. Instead, the browser only contacts the CDN server.
Without these edge servers, the browser must send HTTP requests directly to the origin server containing the page. This consumes the origin server’s resources and can increase the page load time, especially for users located far from the origin server.
Drawbacks of Cached Pages
Stale data is one of the primary challenges of caching. This refers to the situation where the cache contains outdated information that is inconsistent with what is on the original page.
While stale data may not be an issue on static sites, it can be particularly problematic for dynamic content, such as ecommerce pages, stock data, and sports scores. For example, it can cause an ecommerce site to show outdated inventory counts and prices to shoppers.
Another issue is increased memory usage, which can occur when cached content consumes more server and browser resources than intended. This can slow down the server or browser, which will in turn hurt the site’s user experience and performance.
Security issues can also occur in incorrectly configured caches. This can cause sensitive data that should not be cached to get cached. The cached data would then be available to anyone who is able to access the caching platform or user device.