That's correct. And it works like this:

location ^~ /myapp/static/ {
            root /var/www/web2py/applications/myapp/static;
            if ($query_string) {
                expires max;
            }
        }

Which means that it sets a never expire cache header for all files
served from static folder which have a querystring in their url. So
when user comes the first time to my page and loads styles.css?v=1234
nginx will tell to user's browser to cache that file so it doesn't
have to download it over and over again when the user is browsing my
site. So what I want to do is to change that file's url when its
content changes. This way the hash changes and browser will download
the updated file because it doesn't have cache header set for that new
url.

I hope this clarifies what I'm trying to do.

Reply via email to