当前位置:网站首页>浏览器缓存的执行流程
浏览器缓存的执行流程
2022-06-13 00:08:00 【ps酷教程】
HTTP协议中和页面缓存相关的字段,我们先来认识下:
| header | 说明 |
|---|---|
| Expires | 缓存过期的日期和时间 |
| Cache-Control | 设置和缓存相关的配置信息 |
| Last-Modified | 请求资源最后修改时间 |
| ETag | 请求变量的实体标签的当前值,比如文件的MD5值 |

(1)用户首次通过浏览器发送请求到服务端获取数据,客户端是没有对应的缓存,所以需要发送request请求来获取数据;
(2)服务端接收到请求后,获取服务端的数据及服务端缓存的允许后,返回200的成功状态码并且在响应头上附上对应资源以及缓存信息;
(3)当用户再次访问相同资源的时候,客户端会在浏览器的缓存目录中查找是否存在响应的缓存文件
(4)如果没有找到对应的缓存文件,则走(2)步
(5)如果有缓存文件,接下来对缓存文件是否过期进行判断,过期的判断标准是(Expires),
(6)如果没有过期,则直接从本地缓存中返回数据进行展示
(7)如果Expires过期,接下来需要判断缓存文件是否发生过变化
(8)判断的标准有两个,一个是ETag(Entity Tag),一个是Last-Modified
(9)判断结果是未发生变化,则服务端返回304,直接从缓存文件中获取数据
(10)如果判断是发生了变化,重新从服务端获取数据,并根据缓存协商(服务端所设置的是否需要进行缓存数据的设置)来进行数据缓存。
边栏推荐
- Enterprise wechat H5_ Authentication, H5 application web page authorization login to obtain identity
- How to visit a website
- M_ 8: Design a MySQL table for message queue to store message data
- Start blogging
- Do you have to read for PMP?
- The difference between caching and buffering
- [matlab] polynomial calculation
- Online examination questions for September examination of financial management
- How does the PMP handle the withdrawal?
- APISpace 空号检测API接口 免费好用
猜你喜欢

机加工行业MES系统模具行业MES系统CNCl中工行业MES系统MES扫码报工MES数据采集

H5时代leaflet中还在用DivIcon?
![[matlab] two dimensional curve](/img/5a/bd69c78513fe4b59b2c63dc3679841.png)
[matlab] two dimensional curve

array

Examination questions and online simulation examination for safety management personnel of hazardous chemical business units in 2022

【Matlab】符号计算

【Matlab】二维曲线

PMP renewal | PDU specific operation diagram

线上真实排队系统重构案例分享——实战篇

vs studio_ How to use scanf in 2022
随机推荐
March 11, 2022 diary: Mr. Wang's spring, strange template mode
OSM地图本地发布-如何生成各省市矢量地图
What occupation is suitable for PMP?
A detailed explanation of synchronized
PMP training organization
Video tracker error troubleshooting
leaflet中如何通过透明度控制layerGroup的显示隐藏
2022年6月11日记:王老师的春天,混入
SAP 业务技术平台(BTP) Workflow(工作流)功能介绍
[hcie discussion] STP-A
[matlab] 3D curve and 3D surface
【Matlab】矩阵操作
Lower interest rates lead to higher bond prices
M_8:设计消息队列存储消息数据的 MySQL 表格
同花顺开证券账户怎么样?到底安不安全呢
NCF 的Dapr应用实例的运行
Why does the PMP certificate need to be renewed and the renewal process?
How to make maputnik, a vector tile matching artifact, support GeoServer
2022施工员-设备方向-通用基础(施工员)操作证考试题及模拟考试
Cherry Blossom powder Dudu