Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Leverage Browser Caching using .htaccess ? (Google Maps api)

So I have tested my page via Googles Page Insights And it is currently telling me to:

Leverage browser caching for the following cacheable resources: http://maps.google.com/maps/api/js?sensor=false&language=en (30 minutes)

Its rather ironic as its a google resource from a google server But Its always good to know how to do things I've tried to read about how to do this on a link google provided on the test page however it didn't really give an example of how to cache this external resource I've tried reading as much as I can and adding bits into my htaccess file but nothing seems to work.

So I guess my question firstly is, is it even possible via the .htaccess file to cache this resouce? And if so how what code would I need to put in there to get it to cache the resource?

Thanks you In advance for any help.

like image 340
Chris Lad Avatar asked Jun 16 '26 11:06

Chris Lad


1 Answers

You can't control the caching of resources served from third party. htaccess is to control caching for resources served out of your own boxes.

like image 68
Amit Avatar answered Jun 18 '26 03:06

Amit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!