I'm trying to set up caching in nginx so that images will not need to be fetched repeatedly. It seems to be working except that the browser is still making a request for each file with an If-Modified-Since
header. The server then responds with 304 Not Modified
and the actual file isn't transferred again. I can see how this is desired behavior in a lot of cases but in my particular situation it's fine for the files to be up to a week out of date and I would prefer to skip the delay introduced by the extra requests.
Is it possible to add cache headers that tell the browser to always automatically use the cached version until the expiration is reached? My current nginx config is
expires 7d;
add_header Pragma public;
add_header Cache-Control "public";