typekit / webfontloader

Web Font Loader gives you added control when using linked fonts via @font-face.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do not fetch fonts that have already been fetched

AbreezaSaleem opened this issue · comments

I have a function that calls this

WebFont.load({
      google: {
        families: requiredFonts
      }
});

This requiredFonts is computed based on which page number the user clicks from the pagination tab. I want that if the user comes back to a page then WebFont.load should NOT fetch the requiredFonts again and instead get them from the cache. Currently, it keeps making the calls for the fonts that have already been fetched before.

Request Header: cache-control: no-cache
Response Header: cache-control: public, max-age=31536000

Can someone please tell me how I can ensure that it refetches the fonts from the cache instead of making the call again? P.s i am using the fonts that I fetch.

Turns out my disable cache was on.