D
D
del9937882017-10-24 05:53:15
Search Engine Optimization
del993788, 2017-10-24 05:53:15

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)

Tell me how to cache Google maps for a user of a regular shared hosting on a regular html landing page?
ps the answer is not searched on the Internet. There are a lot of articles and not one solution, except for the proposed one, not at all for google maps, solving the problem through cron. I agree to hash the map forever, the information on the map will never change, why do I need cron?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey delphinpro, 2017-10-24
@delphinpro

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.

P
Puma Thailand, 2017-10-24
@opium

First of all, no way, secondly, it's not required.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question