0
votes

I am serving static images that never change with an ad server and I see that the http headers include the following:

Cache-Control: max-age=315360000

Pragma: public

Cache-Control: public, must-revalidate, proxy-revalidate

How do I make browsers cache the data ? My origin server is an nginx.

Thanks!

1

1 Answers

1
votes

add expires max; to the location for your static images, see http://nginx.org/en/docs/http/ngx_http_headers_module.html#expires

Update:

to apply this to a specific directory - let's say a subdir images- you would add the following:

location /images/ {
  expires max;
}