Web Technologies - Old Questions

5.  Explain the functions of web caches.

5 marks | Asked in 2068

A web cache is a HTTP cache for temporary storage of web documents such as HTML pages & images. It helps in temporary storage of frequently accessed static content.

Internet users with similar interests often download the same web content over and over again. Without a proper web cache, every time a user makes request the response must come from the origin server. When many users are requesting content at the same time, response time may increase and server overload may even occur.

Whenever content is downloaded from the origin server, a copy is stored in the web caches for a set period of time. If another user requests the same content again, the web caches sends the stored content and user request doesn't have to be forward to origin server again.

Web-cache flow:

1. A user access a website.

2. A browser sends an HTTP request to the web cache.

    i) If the requested object is stored in cache, the web cache responds with object.

    ii) If the requested object is not stored in cache, the web cache request the object from origin server and sends the response to the browser.