Just wanted to test the ability of the Web Font Loader and surprisingly I have discovered that when I need to load the same font in another page then the loader performs new download instead of using a cached version of the font. Is this normal? If so, is there a simple way to check if the font is available for the browser, in other words whether it is cached?
Here's is how I load the font:
<script>
WebFont.load({
custom: {
families: ['Univers45custom', 'Univers45customIE']
}
});
</script>
I am using Web Font Loader v1.5.10
.
Addendum by BramVanroy: this 'lack of caching' is also present when using Google's webfonts. FOUT (a Flash of Unstyled Text) briefly occurs on a website that uses the font loader even after reloading the page multiple times.
Edit by eldi: Hi BramVanroy -> Right now I am not really sure how I went around this issue, but probably I just used the @font-face
. The reason why I tested the Web Font Loader was the FOUT in the first place. The Loader adds css class to html element which provide you a way to style your page without the right font, when the fonts are loaded then the class is gone and your "standard" styling is present. That was working as expected but with the 'lack of caching' exception, which in my situation was not acceptable. I believe that staypuftman workaround with modifying HTTP header would do the job, I do not have time to test it, especially I would need to do some research to find the way to set it in asp.net hosting provider as setting it from application will add additional processing time.