HTTP cache in depth

HTTP 缓存

https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching?hl=zh-CN

https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Caching_FAQ

强缓存 200

  1. Expires (HTTP/1.0) ?

  2. Cache-Control (HTTP/1.1)

max-age

s-maxage

public/ private

优先级

协商缓存 304

ETag

last-modified


浏览器缓存 / web 缓存

  1. Memory Cache
  2. Service Worker
  3. HTTP cache
  4. Application Cache API (已弃用️)

...

memory cache

200

cache-control / ETag

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

https://github.com/h5bp/server-configs

http://httparchive.org/trends.php#maxage0

PWA

cookie

LocalStorage

SessionStorage

IndexedDB

Web SQL (已弃用️,停止维护,支持者太少了,sqlite)

https://developers.google.com/web/tools/chrome-devtools/storage/applicationcache

https://html.spec.whatwg.org/multipage/offline.html#offline

https://developers.google.com/web/tools/chrome-devtools/storage/websql

https://www.w3.org/TR/webdatabase/#status-of-this-document

https://www.sqlite.org/


HTTP/1.1 HTTP/2 HTTP/3 (QUIC)

  1. 多路复用

http cache 缓存的位置

https://segmentfault.com/a/1190000020086923

从缓存位置上来看,分为4种,从上往下依次检查是否命中,如果但都没有命中则重新发起请求。

Service Worker 是运行在浏览器背后的独立线程,一般可以用来实现缓存功能。

使用 Service Worker的话,传输协议必须为 HTTPS。

Memory Cache 也就是内存中的缓存,主要包含的是当前中页面中已经抓取到的资源,例如页面上已经下载的样式、脚本、图片等。读取内存中的数据肯定比磁盘快,内存缓存虽然读取高效,可是缓存持续性很短,会随着进程的释放而释放。

一旦我们关闭 Tab 页面,内存中的缓存也就被释放了。

内存缓存中有一块重要的缓存资源是preloader相关指令(例如)下载的资源。

它可以一边解析js/css文件,一边网络请求下一个资源。

Disk Cache 也就是存储在硬盘中的缓存,读取速度慢点,但是什么都能存储到磁盘中,比之 Memory Cache 胜在容量和存储时效性上。

绝大部分的缓存都来自Disk Cache,在HTTP 的协议头中设置。

Push Cache(推送缓存)是 HTTP/2 中的内容,当以上三种缓存都没有命中时,它才会被使用。

它只在会话(Session)中存在,一旦会话结束就被释放,并且缓存时



xgqfrms 2012-2020

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


HTTP cache in depth的更多相关文章

  1. Graphics-Processing Architecture Based on Approximate Rendering

    BACKGROUND The present invention generally relates to the processing of graphics data, and particula ...

  2. Design Of A Modern Cache

    http://highscalability.com/blog/2016/1/25/design-of-a-modern-cache.html MONDAY, JANUARY 25, 2016 AT ...

  3. OpenRisc-41-or1200的cache模块分析

    引言 为CPU提供足够的,稳定的指令流和数据流是计算机体系结构设计中两个永恒的话题.为了给CPU提供指令流,需要设计分支预测机构,为了给CPU提供数据流,就需要设计cache了.其实,无论是insn还 ...

  4. In Depth : Android Boot Sequence / Process

    In Depth : Android Boot Sequence / Process What happened when I press power on button in my Android ...

  5. [翻译] Fast Image Cache

    https://github.com/path/FastImageCache Fast Image Cache is an efficient, persistent, and—above all—f ...

  6. Oracle-buffer cache、shared pool

    http://blog.csdn.net/panfelix/article/details/38347059   buffer pool 和shared pool 详解 http://blog.csd ...

  7. HTML5 in depth

    HTML5 in depth Content Models Web Storage web storage 存储用户信息, 替代 cookies LocalStorage SessionStorage ...

  8. ASP.NET Core 折腾笔记二:自己写个完整的Cache缓存类来支持.NET Core

    背景: 1:.NET Core 已经没System.Web,也木有了HttpRuntime.Cache,因此,该空间下Cache也木有了. 2:.NET Core 有新的Memory Cache提供, ...

  9. [Java 缓存] Java Cache之 DCache的简单应用.

    前言 上次总结了下本地缓存Guava Cache的简单应用, 这次来继续说下项目中使用的DCache的简单使用. 这里分为几部分进行总结, 1)DCache介绍; 2)DCache配置及使用; 3)使 ...

随机推荐

  1. <script>元素

    简介 向HTML页面中插入JavaScript的主要方法,就是使用'<'script'>'元素. 标签的位置 现代Web应用程序一般都把全部的JavaScript饮用放在'<'bod ...

  2. 五:Spring Security 中的角色继承问题

    Spring Security 中的角色继承问题 以前的写法 现在的写法 源码分析 SpringSecurity 在角色继承上有两种不同的写法,在 Spring Boot2.0.8(对应 Spring ...

  3. Python3 注释、运算符、数字、字符串

    文章目录 注释 单引号(''') 双引号(""") 运算符 数字(Number) Python 数字类型转换 数学函数 随机数函数 三角函数 数学常量 数字与字符,列表之 ...

  4. python函数的实例,书写一个创建有针对性的专用密码字典的程序

    python学习,实战学习,函数的学习与使用,综合知识的运用.包括for ,while循环,if...else.. 和if... elif ... else 的条件判断! 问题描述:书写一个创建有针对 ...

  5. 关于webservice实现web接口

    package service; import java.util.List; import javax.jws.WebMethod;import javax.jws.WebService; /** ...

  6. Linux常用命令详解(第二章)(cat、more、less、head、tail、clear、poweroff、reboot、alias、unalias、uname、hostname、history、whitch、wc、w、who、whoami、)

    本章命令(共18个): 1 2 3 4 5 6 7 8 9 10 cat more less head tail clear poweroff reboot alias unalias uname h ...

  7. Flink-v1.12官方网站翻译-P022-Working with State

    有状态程序 在本节中,您将了解Flink为编写有状态程序提供的API.请看一下Stateful Stream Processing来了解有状态流处理背后的概念. 带键值的数据流 如果要使用键控状态,首 ...

  8. 坐下坐下,基本操作(ZooKeeper 操作篇)

    本文作者:HelloGitHub-老荀 Hi,这里是 HelloGitHub 推出的 HelloZooKeeper 系列,免费开源.有趣.入门级的 ZooKeeper 教程,面向有编程基础的新手. Z ...

  9. 1153 Decode Registration Card of PAT

    A registration card number of PAT consists of 4 parts: the 1st letter represents the test level, nam ...

  10. BZOJ4566 [Haoi2016]找相同字符【SAM】

    BZOJ4566 [Haoi2016]找相同字符 给定两个字符串\(s和t\),要求找出两个字符串中所有可以相互匹配的子串对的数量 首先考虑可以怎么做,我们可以枚举\(t\)串的前缀\(t'\),然后 ...