Imagine you make a request to the server and it responds with the data you need. The next time you request the same data, your browser already has it stored in its cache. This caching mechanism helps reduce the number of network calls to the server, resulting in faster access to the desired information.
𝐖𝐡𝐲 𝐬𝐡𝐨𝐮𝐥𝐝 𝐰𝐞 𝐮𝐬𝐞 𝐇𝐓𝐓𝐏 𝐜𝐚𝐜𝐡𝐢𝐧𝐠? 😎
✔ To load web resources such as JS, CSS, images, fonts, etc., from the server.
✔ Caching responses from the server.
✔ To decrease traffic load – If the data is already in the browser, it will only validate if the data is correct. If it’s valid, the browser will load the cached data.
✔ To enhance the performance of the application.
𝐇𝐞𝐚𝐝𝐞𝐫𝐬 𝐮𝐬𝐞𝐝 𝐟𝐨𝐫 𝐇𝐓𝐓𝐏 𝐜𝐚𝐜𝐡𝐢𝐧𝐠 𝐢𝐧𝐜𝐥𝐮𝐝𝐞:
– Cache-Control
– Expires
– Last-Modified
– E-Tag
All of the above headers serve the same purpose of storing cache within the browser. So, if you set multiple headers to true, which one takes priority?
Priority ——> 𝐂𝐚𝐜𝐡𝐞-𝐂𝐨𝐧𝐭𝐫𝐨𝐥 >> 𝐄𝐱𝐩𝐢𝐫𝐞𝐬 >> 𝐋𝐚𝐬𝐭-𝐌𝐨𝐝𝐢𝐟𝐢𝐞𝐝 & 𝐄-𝐓𝐚𝐠.
13 Comments
I love reading a post that will make people think. Also,many thanks for permitting me to comment!
If you are going to refrigerate leftovers or retailer aquantity of chicken meals in the fridge, they must be in a sealed container.
Thank you for the auspicious writeup. It in reality was once a enjoyment account it. Look complicated to more introduced agreeable from you! By the way, how can we be in contact?
These are genuinely great ideas in on the topic of blogging.You have touched some pleasant things here. Any way keep up wrinting.
Outstanding post but I was wanting to know if you could write a litte more on this topic? I’d be very thankful if you could elaborate a little bit more. Many thanks!
I really liked your blog article.Really thank you! Much obliged.
I really like and appreciate your blog post. Want more.
This is one awesome article. Will read on…
Im grateful for the blog.Thanks Again. Will read on…
A big thank you for your blog.Much thanks again. Awesome.
Im obliged for the article post.Really thank you! Want more.
Great, thanks for sharing this post. Really Great.
Thanks so much for the post.Thanks Again. Really Great.