Answer the question
In order to leave comments, you need to log in
Caching does not work in nginx when serving content using gzip_static. Why?
Static caching enabled on the server
http {
......
sendfile on;
gzip_static on;
gzip_http_version 1.1;
gzip_proxied any;
gzip_types application/x-javascript text/css;
gzip_disable "msie6";
gzip_vary on;
......
}
server{
............
location ~* \.(jpg|js|jpeg|gif|png|css|gz)$ {
expires 30d;
if (!-e $request_filename) {
return 404;
}
}
.................
}
Cache-Control max-age=2592000
Connection keep-alive
Content-Encoding gzip
Content-Length 44291
Content-Type application/x-javascript; charset=utf-8
Date Sun, 20 Dec 2015 10:21:39 GMT
Etag "567668c6-ad03"
Expires Tue, 19 Jan 2016 10:21:39 GMT
Keep-Alive timeout=5
Last-Modified Sun, 20 Dec 2015 08:37:26 GMT
Server nginx
Vary Accept-Encoding
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question