How to prevent "304 unchanged" in nginx?

I am trying to disable all caches in nginx for testing purposes.

I set the following line

add_header Cache-Control no-cache; 

I see that the page itself is not cached, but images, css and javascripts. I suspect this is due to the fact that Firefox gets the title “304 Not Modified”.

Is there any way to prevent this?

PS:

I think I found it myself. Firefox shows "200 OK" all the time.

Is it correct?

I added

 if_modified_since off; add_header Last-Modified ""; 
+7
source share
3 answers

Sounds right to me.

If the agent (in this case Firefox) says 200 OK, it means that the transfer has occurred.

+7
source

Another way is to use the location directive:

 location ~ \.(html|css|js)(.*)$ { expires -1; add_header Cache-Control no-store; } 
0
source

Another way: ctrl + f5

-nine
source

All Articles