Chrome - “禁用缓存" [英] Chrome - "disable cache"
问题描述
我正在使用 Chrome Dev Tools 调试我正在制作的网络应用程序.我对 Chrome 开发工具中的这个禁用缓存"按钮很好奇:
I am using Chrome Dev Tools to debug a web app I'm making. I'm curious about this "Disable cache" button in Chrome Dev Tools:
谁能告诉我这是做什么的?
Could someone please tell me what this does?
我注意到使用 Offline.js 时出现了一些问题,并发现如果我在 Dev Tools 中选中禁用缓存",它可以正常工作.
I've noticed some problems using Offline.js and discovered if I check "Disable cache" here in Dev Tools it works okay.
但这到底是做什么的?我在我的应用中使用缓存清单,所以它可以离线工作,但是如果在 Chrome 开发工具中点击禁用缓存"实际上只是掩盖了一个对我没有用的更大的问题.
But what exactly is that doing? I am using Cache Manifest in my app so it works offline, but if clicking "Disable Cache" in Chrome Dev Tools is actually just disguising a bigger problem that's not useful to me.
基本上我认为正在发生的事情:
Essentially what I think is happening:
- 我正在加载的图像(请参阅 Offline.js - 在线检查?)Offline.js 检查的图像确定用户是在线还是离线,该图像正在被缓存
- 因此在第一次加载后,它总是在线显示
- 如果我在 Chrome Dev Tools 中禁用缓存,它会正常工作,因为它每次都加载图像的新副本.
- The image I am loading (see Offline.js - checking while online?) which Offline.js checks for to determine if the user if online or offline, that image is being cached
- Hence after the first load, it always appears online
- If I disable cache in Chrome Dev Tools, it works correctly because it's loading a fresh copy of the image each time.
欢迎任何智慧之言.
推荐答案
禁用缓存复选框禁用缓存,表示每次连接服务器时,都会下载再次访问整个网站,甚至已经下载了图像.
The disable cache checkbox disable cache, it means every time you connect a server, you will download again the WHOLE website, even already downloaded images.
当您调试存在缓存问题的应用程序时(您已缓存信息并解析它们但实际数据已更改),可以使用此方法
This may be used when you debug an application that have cache problem (you have cached informations & parsing them but the real data has been changed)
这篇关于Chrome - “禁用缓存"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!