1
votes

I'm developing a web site and i have setting up the following structure in production eviroment:

NGINX (listening 443,proxy_pass) -> Varnish (listening 80) -> NGINX (listenig 8080).

So i can serve via https cached content.

The problem is that i have noticed that google crome is not caching locally content served via SSL (Firefox does)

When i pointed to the 80 port , both, Firefox and Chrome caches the content but chrome does not cache when try 443.

Those are the headers i get for a testing image:


Serving by HTTP

Accept-Ranges:bytes

Age:28

Cache-Control:max-age=31536000

Content-Length:190667

Content-Type:image/jpeg

Date:Fri, 18 Dec 2015 12:06:49 GMT

ETag:"5673f678-2e8cb"

Expires:Sat, 17 Dec 2016 12:06:49 GMT

Last-Modified:Fri, 18 Dec 2015 12:05:12 GMT


Served by HTTPS

Accept-Ranges:bytes

Age:74

Cache-Control:max-age=31536000

Connection:keep-alive

Content-Length:190667

Content-Type:image/jpeg

Date:Fri, 18 Dec 2015 12:19:34 GMT

ETag:"5673f678-2e8cb"

Expires:Sat, 17 Dec 2016 12:06:49 GMT

Last-Modified:Fri, 18 Dec 2015 12:05:12 GMT


Anyone knows if this may be a config problem with my servers, or maybe its a chrome normal way of deal with SSL conections?

Thanks

1
Have you checked with some other ssl server?Alexey Ten
Do you think it can be because of the "Connection:keep-alive" header that nginx generates?Ebmoya
I mean, check with someone else's server, like google.com. And how do you know, that chrome does not cache?Alexey Ten
ahhh! Ok.. i try with stackoverflow and chrome caches content even via SSL. So it must be somethig with mi conf... i think something about the keep-alive conection header. But there is no way to disble it in nginxEbmoya
I check that is not caching with the chrome developments tools (F12).Ebmoya

1 Answers

0
votes

Finally i found the problem.

i remove from the response headers the "Vary: cookies" header and now chrome is locally caching the content served via HTTPS