5

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:

enter image description here

Could someone please tell me what this does?

I've noticed some problems using Offline.js and discovered if I check "Disable cache" here in Dev Tools it works okay.

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:

  • 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.

Any words of wisdom are welcome.

Community
  • 1
  • 1
b85411
  • 9,420
  • 15
  • 65
  • 119
  • The disable cache checkbox does exactly what it says - when you refresh the page with it checked it will request all supplementary files from the server again, instead of reading the previous version of them from the cache. – Rory McCrossan Apr 28 '15 at 08:21
  • 1
    Just to add _Disable cache is only active while devtools is open._ – Satpal Apr 28 '15 at 08:22
  • Here's my problem though - that is okay if Dev Tools is open. But for a regular person using my web app, they can't temporarily disable cache so this image will be able to be reloaded. I need to try and get this to happen automatically in the background. Do you understand what I mean? – b85411 Apr 28 '15 at 08:24
  • hi @b85411 did u get a proper answer to you wuestion , i am facing the same situation when i run my code and i dont want the cache to tell the client to disable their cahe eatch time they load my site!! :( – Dpk_Gopi Nov 08 '17 at 10:24

1 Answers1

6

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)

Alexis Paques
  • 1,885
  • 15
  • 29