当前位置:网站首页>HTTP缓存
HTTP缓存
2022-07-29 01:58:00 【Meme_xp】
强制缓存是什么
不发起http请求,直接使用本地缓存,比如浏览器地址栏回车,使用浏览器的刷新按钮,在Expires或max-age生效的情况下,触发强缓存。
不经常被修改的文件,通常用强缓存
协商缓存,对应缓存
在使用本地缓存前,先与服务器协商,核对缓存文件是否为最新。请求头携带If-None-Match或If-Modified-Since,也可都携带


协商缓存相关的header字段
协商缓存都是由服务器来确定缓存资源是否可用的,所以客户端与服务器端要通过某种标识来进行通信,从而让服务器判断请求资源是否可以缓存访问,这主要涉及到下面两组header字段,这两组搭档都是成对出现的,即第一次请求的响应头带上某个字段(Last-Modified或者Etag),则后续请求则会带上对应的请求字段(If-Modified-Since或者If-None-Match),若响应头没有Last-Modified或者Etag字段,则请求头也不会有对应的字段。
边栏推荐
- ES6 syntax extension
- C language improvement (I)
- Resnet50 + k-fold cross validation + data enhancement + drawing (accuracy, recall, F value)
- How awesome is the architecture of "12306"?
- Day 15 (VLAN related knowledge)
- Altium designer outputs Gerber and other production documents
- 无线振弦采集系统工作流程
- 一文读懂Okaleido Tiger近期动态,挖掘背后价值与潜力
- Problems encountered in special flow & properties property set instances and Solutions
- Virsh console connection failure
猜你喜欢

2022/07/28 学习笔记 (day18) 常用API

会议OA之会议通知

ES6事件绑定(v-on用法)

“12306”的架构到底有多牛逼?

Time pit in MySQL driver

代码实现 —— 多项式的最大公因式(线性代数)
![[cloud native and 5g] micro services support 5g core network](/img/c9/4ccacd1e70285c2ceb50c324e5018c.png)
[cloud native and 5g] micro services support 5g core network

How to quickly design a set of cross end components that support rendering rich text content

Navigation -- realize data transmission and data sharing between fragments

千万不要把Request传递到异步线程里面,有坑
随机推荐
ES6详解 快速上手!
开启TLS加密的Proftpd安全FTP服务器安装指南
响应式织梦模板酒店客房类网站
QT qstackedwidget multi interface switching
[upload picture 2-cropable]
响应式织梦模板家装装饰类网站
Explain the four asynchronous solutions of JS in detail: callback function, promise, generator, async/await
Rust 列表(Vec)复制
MySQL驱动中关于时间的坑
多边形点测试
裂开了,一次连接池参数导致的雪崩问题
Branch management practice of "two pizza" team
What should I do if excel opens a CSV file containing Chinese characters and there is garbled code?
Hexadecimal to string
Servlet三种实现方式
Website Collection
The outsourcing company "mixed" for two years, and I only did five things seriously. Now I get byte offer smoothly.
Virsh console connection failure
如果非要在多线程中使用 ArrayList 会发生什么?
Awvs cannot start problem