Setting expire headers for fonts not working Setting expire headers for fonts not working apache apache

Setting expire headers for fonts not working


Seems I had to include this bit as well:

ExpiresActive on

With the full code being:

# Add correct content-type for fontsAddType application/vnd.ms-fontobject .eotAddType font/ttf .ttfAddType font/otf .otfAddType font/woff .woffAddType font/woff2 .woff2AddType image/svg+xml .svg# Compress compressible fontsAddOutputFilterByType DEFLATE font/ttf font/otf image/svg+xmlExpiresActive on# Add a far future Expires header for fontsExpiresByType application/vnd.ms-fontobject "access plus 1 year"ExpiresByType font/ttf "access plus 1 year"ExpiresByType font/otf "access plus 1 year"ExpiresByType font/woff "access plus 1 year"ExpiresByType font/woff2 "access plus 1 year"ExpiresByType image/svg+xml "access plus 1 year"


I believe your issue is how you define the fonts, and there is no need to add their content-type

 ExpiresByType font/truetype "access plus 1 year" ExpiresByType font/opentype "access plus 1 year" ExpiresByType application/x-font-woff   "access plus 1 year" ExpiresByType image/svg+xml "access plus 1 year" ExpiresByType application/vnd.ms-fontobject "access plus 1 year"