Contents

About web cache

   Jul 13, 2023     2 min read

This article introduced Web Cache.

If you’re working on the FrontEnd, you’ll come across Web Cache fairly often. Let’s take a look at it.

What is a Web Cache

A system that temporarily stores web pages or files from the Internet. When a user accesses a web page, a web cache stores a copy of that page, and the next time the user accesses the same page, the page is fetched from the cache instead of requesting it directly from the web server. This improves the user’s experience and helps reduce network traffic.

This begs the question. If we store a copy of a webpage when a user accesses it, where do we store it?

Where is Web Cache Stored

First of all, web caches can be implemented in many different forms. The main ones include a private cache inside the user’s web browser, a shared cache located on an intermediary server, and a cache on a content delivery network (CDN).

We recognize some of these, but what is a shared cache located on an intermediary server? Here’s a quick refresher.

What is a shared cache located on an intermediary server?

A cache system that is shared by multiple users or clients. These caches are installed on an intermediary server (or proxy server), which accepts requests from users and returns responses to those requests. However, if a copy of the requested resource is already stored in the cache, the intermediary server will fetch it from the cache and serve it to the client instead of making a direct request to the web server.

Public cache advantages

Public caches help reduce network traffic and lighten the load on web servers. When multiple users access the same resource, an intermediary server’s public cache stores a copy of the first requested resource to provide a faster response to subsequent requests for the same resource. This can save network bandwidth and improve overall web performance.

Let’s come back and discuss the benefits of web cache.

Web Cache Benefits

  • Saves bandwidth: Web caching reuses resources that have already been downloaded, saving network bandwidth.
  • Improved response time: Because web caches store copies of web pages locally, there are fewer requests to the web server, which can result in faster response times.
  • Reduced traffic: Because web caching serves copies of web pages from an intermediary server, it reduces the load on your web server and reduces overall traffic.
  • Improved user experience: Because web caches serve web pages locally, they can provide faster page loading and a smoother user experience.