No effect of cache-control no-store seen in nginx in chrome dev tools, why?

I first downloaded two images.

Put them into /usr/share/nginx/html/img directory.

One was named pic-1.jpg, another was named pic-2.jpg.

Remember, I've not added any cache control headers till date.

Now, I went to my-ip-address:80/img/pic-1.jpg. Then I clicked reload a couple of times, so that I can check dev tools and find cache stored there.

But to my surprise, I didn't find anything stored there.

# curl -I 192.168.1.76:80/img/pic1.jpg
HTTP/1.1 200 OK
Server: nginx/1.20.1
Date: Fri, 01 Sep 2023 09:32:26 GMT
Content-Type: image/jpeg
Content-Length: 164619
Last-Modified: Fri, 01 Sep 2023 09:30:40 GMT
Connection: keep-alive
ETag: "64f1af40-2830b"
Accept-Ranges: bytes

This was the output being returned via terminal curl.

Above is the output in chrome dev tools. My expectation is that it should be cached as long as I've not specified to not cache it. Why is it not being cached?

Mind you that about:cache didn't open, so I had to use this chrome dev tools.

And decided to use it. I expect a key-value store of the image there.

Hello,

One possibility is that you were browsing in Incognito mode. Incognito mode does not keep a cache (or more accurately, it discards everything in the temporary cache the moment it is no longer required). I see in the screenshot you've posted that you appear to have been using Incognito mode there, so if this is how you were browsing at the time you loaded the image (or indeed if this is how you normally browse in general), then this would explain why your cache is empty.

2 Likes

actually even out of inconginto mode, i didn't see cache.

i don't believe local files are cached , i think http[s]/....sources have the potential to be cached . more background reading needed to understand the actual behavioural properties is required imo.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.