Web Developer Needs To Know: What Is Browser Cache?
Web Developer Needs To Know: What Is Browser Cache?
In this article, we will refer to Browser Cache , maybe many of you are not unfamiliar with this term, especially web developers and web users. So let's find out in this article! Let's get started now....
When it comes to browser cache, it is related to web programming, so many of you who are not in the web or who are not programmers will often ignore this concept. And in this article, I will explain the simplest way that even non-programmers can understand.
To know this concept, we need to know a little bit of web knowledge. Especially the server-client model. In the previous article, I also shared with you about this client - server model. If you do not know or have not read the article, you can refer to it here.
What is Browser Caching?
When a user uses a browser on a computer to access any website, the browser will download data elements from the web server such as images, fonts, text files.... and combine these components into the complete web page interface displayed in the browser. Those elements will be temporarily cached in the browser. And that is cache memory (Cache).
Browser caching (Vietnamese translation: Browser cache) is a data storage area on the hard drive or on the computer's RAM, used to temporarily store data downloaded by the browser. The data that will be stored in this cache is usually image files, html files, css files, javascript files, depending on which webserver specifies what type to cache. And these temporary data will last for a specified short time, after the specified time, that data will be deleted or refreshed, updated again.
From the next visit to the website, the browser will check the cache first. If the files already exist in the cache, the browser will get those files in the cache, instead of having to download the formatted files again from the server. If the files do not exist in the cache, the browser will send a request to the web server to download.
Simply put, if you buy an item that you use and have leftovers, you will store it in the closet instead of throwing it away. When you need to use that item, you just need to take the item from the closet and use it instead of having to spend time and money running out of the store to buy it.
What is the impact of Browser Caching and Website?
Like the example above, have you saved time and money when using an item, right? Then on the website too, Cache will help the browser load the website faster and save time for web users.
Reasons for browser caching to help websites load faster:
1. Browser caching helps to reduce the load on the server, helping the server to serve many other requests, the requests are processed faster because of the reduced waiting time.
With cached data, when the user accesses the website, the browser will take it out from the cache, instead of sending the request to the webserver, waiting for the server to process and send the results.
2. Loading data from the browser cache will be faster than loading from the server, so the web page load time will be reduced, making the website faster.
3. Reduce the amount of data transmitted from the server to the user's computer because a part of the data is already stored in the machine. This will help reduce website load time. This reduction in transmission capacity is especially meaningful in the problem of bandwidth optimization and transmission cost optimization.
Types of Cache (Browser Cache) As you know, browser cache has 2 types:
Private Cache is reserved for a single user. You may have seen "caching" in your browser settings. The browser cache stores all documents downloaded by the user over HTTP. This caching is used to provide visited documents for navigating back/forward, saving, viewing as source, etc. without requiring an extra trip to the server. It also improves offline browsing of cached content.
Shared cache is a cache that stores responses for reuse by multiple users.
For example, your company may have set up a web proxy as part of its local network infrastructure to serve multiple users so that common resources are reused a number of times, reducing network traffic. and delay.
Comments
Post a Comment