Sysode
Front-End Developer
It's nice to use custom fonts in webpages, rather than the classic web safe fonts. However, using them can sometimes slow down your page load time and this is because the font is downloaded on each page view. First, the page content is download and this is followed by the font
Anyway, I'm here to show one simple solution, using .htaccess.
Simply add this short code to your .htaccess file
What this basically does is, after the visitors first visit, the font is stored on there computer until the set date so there is no need to re-download the font.
There are other ways of doing this, this is just the easiest in my opinion.
Anyway, I'm here to show one simple solution, using .htaccess.
Simply add this short code to your .htaccess file
Code:
<IfModule mod_headers.c>
Header unset ETag
Header unset Last-Modified
</IfModule>
FileETag None
<FilesMatch "\.(eot|woff|ttf|svg|)$">
Header unset Cache-control
Header set Expires "Wed, 28 Apr 2016 20:00:00 GMT"
</FilesMatch>
What this basically does is, after the visitors first visit, the font is stored on there computer until the set date so there is no need to re-download the font.
There are other ways of doing this, this is just the easiest in my opinion.
You must be registered for see links