We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
从缓存位置上来说分为四种,并且各自有优先级,当依次查找缓存且都没有命中的时候,才会去请求网络。
优先级:Service Worker > memory cache > disk cache
Service Worker 是运行在浏览器背后的独立线程(HTTPS或者localhost)。让我们自由控制缓存哪些文件、如何匹配缓存、如何读取缓存,并且缓存是持续性的。
内存中的缓存。一旦我们关闭 Tab 页面,内存中的缓存也就被释放了。例如<link rel="prefetch">
<link rel="prefetch">
硬盘中的缓存。比之 Memory Cache 胜在容量和存储时效性上。
Push Cache(推送缓存)是 HTTP/2 中的内容。它只在会话(Session)中存在,一旦会话结束就被释放,并且缓存时间也很短暂。在Chrome浏览器中只有5分钟左右,同时它也并非严格执行HTTP头中的缓存指令。
关于这点,网上说法不一,不过以下观点比较靠得住:
深入理解浏览器的缓存机制
The text was updated successfully, but these errors were encountered:
sihai00
No branches or pull requests
从缓存位置上来说分为四种,并且各自有优先级,当依次查找缓存且都没有命中的时候,才会去请求网络。
优先级:Service Worker > memory cache > disk cache
1.Service Worker
Service Worker 是运行在浏览器背后的独立线程(HTTPS或者localhost)。让我们自由控制缓存哪些文件、如何匹配缓存、如何读取缓存,并且缓存是持续性的。
2.Memory Cache
内存中的缓存。一旦我们关闭 Tab 页面,内存中的缓存也就被释放了。例如
<link rel="prefetch">
3.Disk Cache
硬盘中的缓存。比之 Memory Cache 胜在容量和存储时效性上。
4.Push Cache
Push Cache(推送缓存)是 HTTP/2 中的内容。它只在会话(Session)中存在,一旦会话结束就被释放,并且缓存时间也很短暂。在Chrome浏览器中只有5分钟左右,同时它也并非严格执行HTTP头中的缓存指令。
5.浏览器会把哪些文件丢进内存中?哪些丢进硬盘中?
关于这点,网上说法不一,不过以下观点比较靠得住:
参考
深入理解浏览器的缓存机制
The text was updated successfully, but these errors were encountered: