WebPagetest Forums
Leverage browser caching for external JavaScripts - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Optimization Discussions (/forumdisplay.php?fid=5)
+--- Thread: Leverage browser caching for external JavaScripts (/showthread.php?tid=8008)



Leverage browser caching for external JavaScripts - HafezNa - 11-15-2011 08:42 PM

Hi friends

I optimized my site (HafezNa.ir)...for all items
but I get a "Leverage browser caching" warning for an external JS
(for example for "google analysis" or statcounter)

how can solved it??


RE: Leverage browser caching for external JavaScripts - pmeenan - 11-16-2011 01:35 AM

You can't. Just make sure you are loading the scripts asynchronously and that's the best you are going to be able to do.

Looking at your site, one big win you can get will be fixing the blocking issue with IE conditional comments. You have:

Code:
<!--[if IE 7.0]><style>.clearfix { display: inline-block; } /* IE7xhtml*/</style><![endif]-->

directly after your external css and that is causing all versions of IE to not load the rest of the content on the page until the css finishes loading. If you add an empty conditional comment to the top of the page it should "unstick" IE and load more in parallel.

More info here: http://www.phpied.com/conditional-comments-block-downloads/

Thanks,

-Pat


RE: Leverage browser caching for external JavaScripts - HafezNa2 - 11-18-2011 06:33 AM

I don't know why I banned from The forums...

any way...
thank you very much Pmeenan
It was a great help for me,I didn't know that note;

The results was great:

before fix:
http://www.hafezna.ir/img/before.jpg

after fix:
http://www.hafezna.ir/img/after.jpg

can you check my source agian please...
I welcome your valuable suggestions and comments Smile