Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Tutorials
Increasing page load time when using @font-face
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Sysode" data-source="post: 210414" data-attributes="member: 25453"><p>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</p><p> </p><p>Anyway, I'm here to show <strong>one</strong> simple solution, using .htaccess.</p><p> </p><p>Simply add this short code to your .htaccess file</p><p>[CODE]<IfModule mod_headers.c></p><p>Header unset ETag</p><p>Header unset Last-Modified</p><p></IfModule></p><p>FileETag None</p><p><FilesMatch "\.(eot|woff|ttf|svg|)$"></p><p>Header unset Cache-control</p><p>Header set Expires "Wed, 28 Apr 2016 20:00:00 GMT"</p><p></FilesMatch>[/CODE]</p><p> </p><p>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.</p><p> </p><p>There are other ways of doing this, this is just the easiest in my opinion.</p><p> </p><p> </p><p> </p><p> </p><p><a href="http://pastebin.com/k9WQtZxX" target="_blank">http://pastebin.com/k9WQtZxX</a></p></blockquote><p></p>
[QUOTE="Sysode, post: 210414, member: 25453"] 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 [B]one[/B] 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>[/CODE] 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. [URL]http://pastebin.com/k9WQtZxX[/URL] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Tutorials
Increasing page load time when using @font-face
Top