Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

缓存 和 存储 #46

Open
Lawguancong opened this issue Sep 4, 2021 · 0 comments
Open

缓存 和 存储 #46

Lawguancong opened this issue Sep 4, 2021 · 0 comments

Comments

@Lawguancong
Copy link
Owner

Lawguancong commented Sep 4, 2021

  • dns缓存
  • cdn 代理服务器缓存(服务器)
  • http/服务器缓存
  • 离线缓存
  • 数据库缓存?
  1. service worker
  2. memory
  3. disk
  4. push cache
    https://jakearchibald.com/2017/h2-push-tougher-than-i-thought/
  • 强缓存
  • 协商缓存
    • Last-Modified,If-Modified-Since
    • ETag、If-None-Match
  • 启发式缓存 通常会取响应头的Date_value - Last-Modified_value值的10%作为缓存时间。

200:强缓Expires/Cache-Control存失效时,返回新的资源文件
200(from cache): 强缓Expires/Cache-Control两者都存在,未过期,Cache-Control优先Expires时,浏览器从本地获取资源成功
304(Not Modified )

1、cookie:4K,可以手动设置失效期
2、localStorage:5M,除非手动清除,否则一直存在
3、sessionStorage:5M,不可以跨标签访问,页面关闭就清理
4、indexedDB:浏览器端数据库,无限容量,除非手动清除,否则一直存在
5、Web SQL:关系数据库,通过SQL语句访问(已经被抛弃)

参考链接
https://juejin.cn/post/6993358764481085453
amandakelake/blog#43
amandakelake/blog#41
amandakelake/blog#13
amandakelake/blog#15
amandakelake/blog#44
https://www.jianshu.com/p/54cc04190252
https://juejin.cn/post/6947936223126093861
https://juejin.cn/post/6844903763665240072
https://www.jianshu.com/p/54cc04190252
https://juejin.cn/post/6844904100035821575#heading-58

@Lawguancong Lawguancong changed the title 缓存 缓存 和 存储 Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant