Welcome! Log In Create A New Profile

Advanced

Re: Ngnix wont cache woff

Francis Daly
October 05, 2016 09:26AM
On Wed, Oct 05, 2016 at 10:39:36AM +0200, Brent Clark wrote:

Hi there,

> 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@bclark:~$ curl -I
> http://$REMOVEDDOMAIN/wp-content/themes/REMOVED-v5-2/fonts/adelle_bold-webfont.woff
<snip>
> 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_ignore_headers Vary;
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,
then.)

Cheers,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Ngnix wont cache woff

Brent Clark October 05, 2016 04:40AM

Re: Ngnix wont cache woff

Francis Daly October 05, 2016 09:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 112
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready