Is there a way to tell the client-side user, through the browser, if certain images are loading from cache or if they are being loaded from the server?
Asked
Active
Viewed 608 times
0
-
Check out [this](http://stackoverflow.com/questions/1192458/how-to-check-whether-the-images-are-from-cache) – Emmanuel N Mar 31 '12 at 17:00
-
I specifically want to check if the image is even in the cache for that specific user – re1man Mar 31 '12 at 17:06
-
Can you explain what problem you're really trying to solve? You can load an image and time how long it loads which will give you a pretty good idea of whether it came from the cache or not, but after that it's now in the cache. I'm not aware of any way to know beforehand if it's in the cache. You can force it to load from the server by appending a varying query parameter to the URL. – jfriend00 Mar 31 '12 at 17:15
-
or this http://stackoverflow.com/questions/5173656/how-to-check-if-jquery-ajax-request-header-status-is-304-not-modified – mplungjan Mar 31 '12 at 17:18
-
1304 is only for not modified, you can still get status 200 headers that come from cache. – Declan Cook Mar 31 '12 at 17:22
1 Answers
0
You can through the browsers console. For Example inside chrome the network tab will tell you details about each resource, as for doing it in JavaScript I'm not sure you have that much control over images.

Declan Cook
- 6,066
- 2
- 35
- 52