I have a WordPress website running on an Nginx webserver on Ubuntu. The site basically runs fine, quite fast, no significant problems.
I do get this error in a Google Pagespeed Insights test. It started the moment after I applied Cloudflare to my domain:
Leverage browser caching
Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network. Leverage browser caching for the following cacheable
resources: https://example.com/…/fonts/fontawesome-webfont.woff2?v=4.7.0 (4 hours)
I thought I might need to add woff2
to my Nginx location block dealing with resource expiration:
location ~* \.(jpg|jpeg|png|gif|ico|css|js|ttf|woff|woff2|pdf)$ {
expires 365d;
}
Note the woff2
after the woff
. I then restarted the server but no significant change was seen.
I do wonder, mostly out of curiosity, why applying Cloudflare caused the appearance of this Google Pagespeed Insights error.