xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

浏览器 HTTP Cache 缓存的存储位置、优先级、条件、机制、原理是什么 All In One

浏览器 HTTP Cache 缓存的存储位置、优先级、条件、机制、原理是什么 All In One

  1. memory cache
  2. disk cache

浏览器缓存

HTTP cache 存储位置、优先级、条件、 机制、原理是什么?

from memory cache
from disk cache

🕵️‍♂️这块内容,目前看来没有比较正确的答案呀

image

image

现在我是这么理解的 ✅

  1. 首先所有的资源第一次加载后,都是存在 memory cache 里面的;浏览器然后,根据 http cache 策略(强缓存/协商缓存),判断某个资源是否要 写入 disk cache;
  2. 后面,刷新页面再次请求资源的时候,浏览器按照(暂不考虑 service worker 等其他缓存)memory cache > disk cache 的顺序依次查找资源,直到命中,或重新请求;

The cache from which the request got matched can have an impact on the way this request is represented in DevTools and Resource Timing.

匹配请求的缓存可能会影响此请求在 DevTools 和 Resource Timing 中的表示方式。

https://calendar.perfplanet.com/2016/a-tale-of-four-caches/

强缓存 & 协商缓存

强缓存:

  • expires
  • Cache-Control

协商缓存:

  • ETag / If-None-Match
  • Last-Modified / If-Modified-Since

demos

https://cdn.xgqfrms.xyz/

https://cdn.xgqfrms.xyz/http-cache/index.html

image

image

refs



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @   xgqfrms  阅读(993)  评论(5编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2018-05-19 swiper & swiper slider
2018-05-19 Vue 2.x All In One
2017-05-19 React 2017
2016-05-19 video.js 使用手册& bugs
2016-05-19 CSS3 @font-face 使用教程: 各种 font-type (.eot .woff .ttf .svg)=== format('woff') ;format('embedded-opentype')/format("eot") ;format('truetype');format('svg');
2016-05-19 JW Player
2016-05-19 Difference between OGV and OGG All In One
点击右上角即可分享
微信分享提示