Ответ 1
Сделайте отдельный блок местоположения для config.js над другими.
location ~ config\.js {
alias xyz;
expires off;
}
location static etc
location /static {
alias /home/ubuntu/Documents/zibann/momsite/momsite/static; # your Django project 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;
}
}
Наделение config.js
не будет кэшироваться, но это так.
Как я могу исключить один файл из кэша?
Сделайте отдельный блок местоположения для config.js над другими.
location ~ config\.js {
alias xyz;
expires off;
}
location static etc