Question
Nginx cashe validation is not working properly?
Hello
I have added cache to Nginx. But changed static files (css,images) are not updated untill I press F5. That is wrong
Maybe you can advice me what to do.
Here is part of server config
server {
listen 80;
server_name 111.111.111.111 sitename.ru;
etag on;
if_modified_since exact;
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|pdf)$
{
root /storage/www;
expires 30d;
add_header Cache-Control 'public';
}
fastcgi_pass unix://var/run/php-fpm/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /storage/www$fastcgi_script_name;
fastcgi_pass_header Last-Modified;
include fastcgi_params;
fastcgi_read_timeout 240s;
fastcgi_send_timeout 240s;
fastcgi_intercept_errors on;
}
Here is header of CSS
<^>HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Fri, 03 Jun 2016 22:46:02 GMT
Content-Type: text/css
Content-Length: 16150
Last-Modified: Fri, 03 Jun 2016 22:06:24 GMT
Connection: close
ETag: “5751ff60-3f16”
Expires: Sun, 03 Jul 2016 22:46:02 GMT
Cache-Control: max-age=2592000
Cache-Control: public
Accept-Ranges: bytes<^>
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.
×