当前位置:网站首页>HTTP cache, forced cache, negotiated cache
HTTP cache, forced cache, negotiated cache
2022-07-06 07:33:00 【Let the code fly 1926】
What is caching ?
When the browser loads a web page , You need to load some resources ,html,css,js,img..., All requests are required for the first time , When the second time , The third time I visited this page , In fact, you can not send the request repeatedly , You can use http Cache policy , Make the web page load faster .
Mandatory cache
The browser sends a request to the server , The server should return to the client resource , But the client wants to cache these resources , You need to set the response header cache-control:max-age=31536000, In this way, the browser will cache resources , Check it the next time you ask max-age Has it expired , If it doesn't expire , Just take resources directly , If it's out of date , Just send a request , If you don't use caching, use no-cache
Negotiate the cache
Using negotiation cache , The browser makes a request for the first time , The server will return resources and resources identification , Then put the resources locally , At the next request , Send the request together with the resource ID to the server , The server determines the ID sent and the latest resource ID on the server , If it's the latest , The server returns 304 Status code , Get resources directly from the cache , If it's not the latest , Just go back to 200 Status code and the latest resource and resource identification
Resource identification :
There are two kinds of , One is last-Modified: Last modification time of resource , It's only accurate to seconds , The key name when sending the request is :if-Modified-Since
One is ETag: The unique string corresponding to the resource , The key name when sending the request is :if-None-Match, priority of use ETag
边栏推荐
- Scala language learning-08-abstract classes
- Oracle column to row -- a field is converted to multiple rows according to the specified separator
- 超级浏览器是指纹浏览器吗?怎样选择一款好的超级浏览器?
- 杰理之BLE【篇】
- Three treasures of leeks and Chinese men's football team
- word中把帶有某個符號的行全部選中,更改為標題
- OpenJudge NOI 2.1 1661:Bomb Game
- Three no resumes in the software testing industry. What does the enterprise use to recruit you? Shichendahai's resume
- Go learning -- implementing generics based on reflection and empty interfaces
- OpenJudge NOI 2.1 1661:Bomb Game
猜你喜欢

leecode-C语言实现-15. 三数之和------思路待改进版
TS 类型体操 之 extends,Equal,Alike 使用场景和实现对比
![[computer skills]](/img/30/2a4506adf72eb4cb188dd64cce417d.jpg)
[computer skills]

Typescript interface and the use of generics

Related operations of Excel

SSM learning

qt颜色与字符串、uint相互转换

Summary of Digital IC design written examination questions (I)

Mise en œuvre du langage leecode - C - 15. Somme des trois chiffres - - - - - idées à améliorer

opencv学习笔记九--背景建模+光流估计
随机推荐
杰理之BLE【篇】
洛谷P1836 数页码 题解
Apache middleware vulnerability recurrence
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Week6 weekly report
QT color is converted to string and uint
Basics of reptile - Scratch reptile
软件测试界的三无简历,企业拿什么来招聘你,石沉大海的简历
leecode-C語言實現-15. 三數之和------思路待改進版
Jerry needs to modify the profile definition of GATT [chapter]
[online problem processing] how to kill the corresponding process when the MySQL table deadlock is caused by the code
Significance and measures of encryption protection for intelligent terminal equipment
杰理之蓝牙设备想要发送数据给手机,需要手机先打开 notify 通道【篇】
How MySQL merges data
The way to learn go (I) the basic introduction of go to the first HelloWorld
word设置目录
GET/POST/PUT/PATCH/DELETE含义
C语言 简单易懂的高精度加法
How to delete all the words before or after a symbol in word
[MySQL learning notes 29] trigger