Cache-control for font headers


(Norman Goh) #1

Hi All,

Can someone please help us with an issue where on IE, where fonts are displaying correctly only when we navigate to a page using a web page link. But on refreshing the page you navigate to, the fonts don’t display.

Test page: https://www.aut.ac.nz/test/test-font (Click on “Go to test page 2” > Font loads > refresh test page 2 > Font doesn’t load)

We found this… https://stackoverflow.com/questions/13415073/on-ie-css-font-face-works-only-when-navigating-through-inner-links
saying that one solution is to make sure cache-control is not saying “no-cache”.

We have tried Root Node Specific cache setting but that doesn’t seem to do anything. We still see the response header saying “no-cache”.

We have also tried setting “Send No-Cache Header for File assets?” in the system configuration screen to “No” but that doesn’t seem to do anything either. Likewise response header still says “no-cache”.

Does anyone know of a sure way to resolve this issue? Or how we can set cache-control?

We’re on version 5.4.3.0

Thanks.


(Marcus Fong) #2

There are a few places you need to check if you need Matrix to send cacheable headers.

First is Send Cacheable Headers in System Configuration: https://matrix.squiz.net/manuals/system-configuration/chapters/system-configuration#HTTP-Headers-Settings

Next is the Send Cacheable Header screen in your Cache Manager: https://matrix.squiz.net/manuals/system-management/chapters/cache-manager#Send-Cacheable-Header-Screen

In particular, you should check whether cacheable headers are on for both the HTTP and HTTPS protocols, especially if your Matrix instance was started a long time ago (in older versions of Matrix the default was HTTP only, and upgrades don’t change the setting).

Finally you should ensure that you’re not logged in while testing, because by default Matrix only sends cacheable headers for logged-in users. (If you need to change this it can also be done from the Send Cacheable Header screen, but this should never be done without careful consideration of the risks. In the wrong circumstances it might result in one user’s personalised content being cached and displayed to another user.)


(Aleks Bochniak) #3

https://www.aut.ac.nz/__data/assets/css_file/0018/279/myfontswebfontskit.css

WOW! that’s a lot of fonts!!!


(Tbaatar) #4

If in doubt load all :wink:


(Norman Goh) #5

So it looks like we had an overwriting setting on our haproxy config file that has no-cache on as part of a template to meet OWASP guidelines. But at least now we have a reason to turn that setting off… IE.

Yeah a lot of fonts as part of our brand guidelines.

Thanks all.