I'm asking this because of the following situation:

Fonts from my system were taking 2-6s to load.

To improve this, I made the system load the same font from google repository, and I remove the css call to the font that was located on my own system's folder.

Now the font takes about 250ms to be loaded (nice result!), but due to some other problems, Now I have 3 http requests being done to the font (two duplicated ones due to an iframe issue, and a third one).

So my question is: If before my changes, the fonts were taking 4s to load.. with one request, and now it is taking let's say 750ms (sum of the three http requests), even if I have raised the number of http requests, can I affirm that I optimized my page?) I mean.. if the download time of these three requests are taking less time than the one, for me it's clear I improved the system... Do you agree with me?)

  • Yes, I would agree with you. Because it's the same font being loaded 3 times, you may also benefit from it being cached on requests 2 and 3. Mar 25 '15 at 14:51
  • exactly... this is what happens.. Mar 25 '15 at 15:19

Yes, if load time is lower, you will have optimised the page. Also, the font file will be cached after the first request, so you will most likely end up with only a single request for the font file.

To verify, you could use your browser's built-in timeline, or use an external tool like Google PageSpeed Insights: https://developers.google.com/speed/pagespeed/insights/.

  • Thanks.. I was already using the browsers built-in timeline.. while the changes are only on development env., I can't them test on thirdy-party websites yet. Mar 25 '15 at 17:34

I'm gonna say mostly yes and rarely no. The reason why is because you are relying on google to process part of your webpage by supplying part of the assets (in your case, fonts). If google at any point goes offline due to technical reasons (or any other reason), and at the same time, a new request is made to your page, then the fonts will not load.

You mentioned:

but due to some other problems, Now I have 3 http 
requests being done to the font (two duplicated ones due to an iframe 
issue, and a third one).

So its very likely your slow loading issue is the result of your website being popular and having fonts load three times instead of one. If you can, try using something else instead of iframes. The only time I use an iframe is if I present a third-party page within my own.

Also, check your webpage with gtmetrix.com and you could get a bad grade on one element talking about minimizing http requests. Try to make your number of http requests per page 5 at the most.

  • This is an important point you made. Iframes are not necessarily good and should be avoided unless absolutely required. As well, I would like to say that for a period that Google was slow serving up GA and Adsense ads which counted in the page speed. Reliance upon 3rd parties to serve up elements of a site can really effect a sites performance and even Google can be slow. We do not always have a choice, but we do need to take this into account. Great points!!
    – closetnoc
    Mar 25 '15 at 16:20
  • 1
    I tottaly agree... I never used iframes since I never had a reason to. (in this case, the iframe wasn't added by me, and I can't remove it for this moment at least. but all the team is aware of this problem (because it's generating duplicated http requests). Mar 25 '15 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.