location /static {
alias /home/ubuntu/Documents/zibann/momsite/momsite/static; # your Django project's static files - amend as required
if ($uri ~* ".*config.js") {
expires off;
}
if ($uri ~* ".*\.(js|css|png|jpg|jpeg|gif|swf|svg)" ) {
access_log off;
expires 365d;
add_header Cache-Control public;
}
}
Hoping config.js
would not get cached, but it does.
How can I exclude one file from being cached?
Make a separate location block for config.js above the others.
location ~ config\.js {
alias xyz;
expires off;
}
location static etc