Ngnix wont cache woff
francis at daoine.org
Wed Oct 5 13:24:54 UTC 2016
On Wed, Oct 05, 2016 at 10:39:36AM +0200, Brent Clark wrote:
> Im struggling to get nginx to cache woff and woff2 file.
> It would appear its the particular wordpress theme is set to not cache.
> But I would like to override that.
> bclark at bclark:~$ curl -I
> Expires: Wed, 05 Oct 2016 09:28:31 GMT
> Vary: User-Agent
> Pragma: public
> Cache-Control: max-age=3600
> Here is my code: http://pastebin.com/RAVKYipU
For "woff", that has:
proxy_ignore_headers Cache-Control Vary Expires Set-Cookie X-Accel-Expires;
proxy_cache_valid 404 1m;
For "swf" it has:
proxy_cache_valid 404 3m;
For how long do you want your "woff" content cached by nginx? If it
is a fixed amount, set proxy_cache_valid suitably. If it is "whatever
Cache-Control says", remove that from proxy_ignore_headers.
(Aside: it is usually friendlier to include the config in the email, so
that someone in next year will be able to see the complete question. It's
possible that that pastebin link may not have the same content as today,
Francis Daly francis at daoine.org
More information about the nginx