WOFF and WOFF2 Font Missing Cache-Control
-
I’m using nginx and have noticed that all my woff and woff2 font files loading from my cloudfront CDN do not have any cache-control settings.
Below is the nginx config that W3Total Cache is building for me. Any idea why in my browser the Cache-Control column is empty for files like this…
https://cdn.mywebsite.com/wp-content/themes/buddyboss-theme/assets/fonts/SFUIText-RegularItalic.woff https://cdn.mywebsite.com/wp-content/plugins/buddyboss-platform/bp-templates/bp-nouveau/icons/bb-icons.woff2?80309866
This is my nginx.conf file created by W3TC
# BEGIN W3TC CDN location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css)$ { expires 31536000s; etag on; if_modified_since exact; add_header Pragma "public"; add_header Cache-Control "public"; add_header X-Powered-By "W3 Total Cache/0.15.2"; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; add_header Referrer-Policy "no-referrer-when-downgrade"; add_header Access-Control-Allow-Origin "*"; } # END W3TC CDN # BEGIN W3TC Browser Cache gzip on; gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd.ms-fontobject application/x-msdownload image/x-icon application/json application/vnd.ms-access video/webm application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application/pdf application/vnd.ms-powerpoint image/svg+xml application/x-shockwave-flash image/tiff application/x-font-ttf audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel; location ~ \.(css|htc|less|js|js2|js3|js4)$ { expires 31536000s; etag on; if_modified_since exact; add_header Pragma "public"; add_header Cache-Control "public"; add_header X-Powered-By "W3 Total Cache/0.15.2"; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; add_header Referrer-Policy "no-referrer-when-downgrade"; try_files $uri $uri/ /index.php?$args; } location ~ \.(html|htm|rtf|rtx|txt|xsd|xsl|xml)$ { expires 3600s; etag on; if_modified_since exact; add_header Pragma "public"; add_header Cache-Control "public"; add_header X-Powered-By "W3 Total Cache/0.15.2"; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; add_header Referrer-Policy "no-referrer-when-downgrade"; try_files $uri $uri/ /index.php?$args; } location ~ \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|webp|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|webm|mpp|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|_ttf|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ { expires 31536000s; etag on; if_modified_since exact; add_header Pragma "public"; add_header Cache-Control "public"; add_header X-Powered-By "W3 Total Cache/0.15.2"; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; add_header Referrer-Policy "no-referrer-when-downgrade"; try_files $uri $uri/ /index.php?$args; } add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; add_header Referrer-Policy "no-referrer-when-downgrade"; # END W3TC Browser Cache # BEGIN W3TC Minify core rewrite ^/wp-content/cache/minify/ /index.php last; # END W3TC Minify core
Other files like this…
https://cdn.mywebsite.com/wp-content/plugins/buddyboss-platform/bp-templates/bp-nouveau/css/buddypress.min.css.gzip
Have a Cache-Control value of
max-age=31536000, public
which I was expecting for the font files also.
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘WOFF and WOFF2 Font Missing Cache-Control’ is closed to new replies.