Answer the question
In order to leave comments, you need to log in
How to cache Google maps?
Hello. GooglePage speed swears at the google maps script:
Use the Browser Cache
If you specify the expiration date or expiration date of static resources in HTTP headers, the browser will load previously obtained resources from the local disk, and not from the Internet.
Use the browser cache for the following resources:
https://maps.googleapis.com/…SAo-p3ebQX5anhfE0Udf2... (30 minutes)
Answer the question
In order to leave comments, you need to log in
No way. This is a different server. And its owners set the caching time for their resources.
But you can go for a trick. I do this, it also speeds up the initial page load.
We are not loading the map . We do not load the Maps API .
Instead of a map, we insert a picture-screenshot of the desired area, it can be worthless quality.
We hang onclick, touchstart and mousemove events on the image. In the handler, we load the API, initialize the map. The real map replaces the picture.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question