The TTL for each browser and server is specified in the HTTP headers. If you load the page after the TTL has expired, the browser will have to place another request to the web server and receive a fresh copy of the resource. There is a set time frame, known as Time to Live (TTL) beyond which the cached resource will expire from the local files. The browser cache does not store the files for an indefinite period of time though. Instead, it is loading the image from your local files. This is because the browser is not requesting the image again from the web server. The next time you visit the page, you will notice that the page loads faster and latency is reduced. The first time you load the page, the image gets saved in your browser cache. You can see it in action when you load a web page with a background image for example. What is Browser Caching?īrowser caching is the process by which a web browser saves website resources in order to load them quickly during the next client request. Cache-Control specifies when and how a response should be cached and for how long. This means that when the browser has to retrieve the last modified files again, it doesn’t need to make a request to the web server again. When a client makes a request to the server, the browser can cache, or store copies of resources for faster access and lower latency. Ĭache-Control is a HTTP cache header that contains a set of parameters to define the browser’s caching behavior in the client requests and server responses. HTTP headers are elements or parameters in this format that include additional information to make the HTTP transaction go smoothly. The user is the client, who sends a request to a web server (say in the form of a URL) and the web server responds (with a web page). Since the release of HTTP/1.1 in 1997, there were few changes to the protocol until HTTP/2 was released in 2015.īoth HTTP/1.1 and HTTP/2 include a number of elements intended to make caching work as well as possible. This is a protocol that dictates the standard of communication on the internet. When a user browses the internet, the communication follows what is called the Hyper Text Transfer Protocol (HTTP) format. Without cache-control, the browser caching and the resulting experience for the user will be sub-optimal. Cache-control is an important way by which developers can dictate how resources will be cached when a user browses the internet.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |