Report this

What is the reason for this report?

Browser Caching with Nginx's issue

Posted on March 25, 2018

Hallo,

i have use this tutorial but i have the problem. I put html files on epoch but these files are cached.

Clould anyone help me out please?

https://i.imgur.com/UlM31tr.png

atm i have add this code to resolve the problem, but im still confused why i need this

        add_header Last-Modified $date_gmt;
        add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
        if_modified_since off;
        expires off;
        etag off;



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

It appears to be working for me:

~ ❯❯❯ curl -i https://anzahcraft.de/test.html
HTTP/2 200 
server: nginx
date: Sun, 25 Mar 2018 19:26:02 GMT
content-type: text/html
content-length: 1024
vary: Accept-Encoding
last-modified: Sunday, 25-Mar-2018 19:26:02 GMT
cache-control: no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0

Do you get the same issue in a different browser? There’s an option to disable caching while the developer tools window is open in the developer tools settings pane. What happens when you enable that and reload the page?

This comment has been deleted

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.