Leverage browser cache for external files ????

756 views
Skip to first unread message

V. Antonacci

unread,
Aug 31, 2017, 12:49:49 AM8/31/17
to pagespeed-insights-discuss
Using the Google Page Speed Insights tool, I finally got my page to almost perfect after a very painful and long effort, LOL. The only thing slowing down my pages now are ...

  1. The Google Adsense .js file needed for ads to render.
  2. Google custom search box .js and CSS files.
  3. Google Analytics .js file.
  4. Certain Ads.
The user (even if in full control of his/her server) cannot 'leverage browser cache' for external files. I was able to achieve all the other speed suggestion items via inline CSS, .htaccess addidtions, gzip  compression, etc, BUT, I CANNOT 'leverage browser cache' for external files or optimize CSS that is made on the fly via javascript (which is how the Google custom search box works I think)

I am a getting a lower speed score because of these things ...

IS there a way to leverage the browser cache for these files listed below longer than 60 minutes and 2 hours or does Google have to do that?

Carlos Lizaga Anadon

unread,
Aug 31, 2017, 3:53:16 AM8/31/17
to pagespeed-insights-discuss
Hi V. Antonacci,

I am sorry to say that there's no way unless you plan to host those scripts yourself with a longer expiration time which, I don't recommend.
You will need to live with that penalization or remove those resources from your site.

Best,
Carlos.

Anatoliy Dovgun

unread,
Sep 3, 2017, 11:43:42 PM9/3/17
to pagespeed-insights-discuss
Using Google Tag Manager, after them you have only one biggest scritp - and then Win GTM (its really way :)

четверг, 31 августа 2017 г., 7:49:49 UTC+3 пользователь V. Antonacci написал:

Hassan Ali Asif

unread,
Oct 13, 2018, 7:36:26 PM10/13/18
to pagespeed-insights-discuss
Is there anyone to tell me how to fix leverage browser caching for external files?
my site url is listed below...
my gtmetrix score is 92% and I still want to improve it...?

Rick Steinwand

unread,
Oct 15, 2018, 7:59:53 AM10/15/18
to pagespeed-insights-discuss
Carlos had the correct answer. All you can do is copy those files to your server and change you links to point to those files. BUT, you'll have to figure out how to periodically check for updated files and recopy it to your server again.

This is beyond the ability of most readers here OR just more work than what most of us want to do.

So, you're stuck with your score of 92. Learn to cope with it.
Reply all
Reply to author
Forward
0 new messages