Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How long are Google Static Map custom markers cached for?

How long are Google Static Map custom markers cached for?

When setting a custom marker and then changing it (eg, using the same file name but a different image) it seems to cache the first file used. This is awkward when tweaking a design.

like image 873
Phillip B Oldham Avatar asked Feb 18 '10 09:02

Phillip B Oldham


People also ask

Can you cache Google Maps?

Once you have the area you'd like to cache in view, type “okay maps” into the search box. Google will take a moment to “pre-load” the area and then save the copy to your device's offline cache. Once it's cached you can use the map at any time, even in Airplane mode.

What is the maximum number of markers on Google Maps?

2048 characters in URL is just under 100 GeoCode values. So, again no more than 100 markers.

What is the maximum number of markers or path vertices supported by the Google Static maps API?

The maximum is 15. Note that this limit applies only to markers specified as a human-readable address that requires geocoding. It does not apply to markers specified with latitude/longitude coordinates. Too many geocoded polyline vertices requested (max is 15).

Is Google Maps static free?

The Maps Static API uses a pay-as-you-go pricing model. Requests for the Maps Static API are billed under the SKU for Static Maps. Along with the overall Google Terms of Use, there are usage limits specific to the Maps Static API. Manage your costs and usage with tools available in the Google Cloud Console.


2 Answers

As far as I know there is no policy for this (so it may change without notice) - right now they seem to expire in 1 day.

Requesting http://chart.apis.google.com/chart?chst=d_map_pin_icon&chld=cafe|996600 returned the following headers

Date          Tue, 16 Nov 2010 00:35:41 GMT
Expires       Wed, 17 Nov 2010 00:35:41 GMT
Cache-Control public, max-age=86400
like image 168
giorgiga Avatar answered Sep 28 '22 14:09

giorgiga


You can pass extra parameters to the static maps API if you want to, Google will just ignore them and you can use it for cachebreaking. We did this all the time for testing in a place I used to work.

Usually we tagged the time onto the url in the request, and it'd prevent it from being cached:

http://chart.apis.google.com/chart?chst=d_map_pin_icon&chld=cafe|996600&time=1290371937

Or set your web browser to stop caching images while you're testing.

like image 42
Teario Avatar answered Sep 28 '22 12:09

Teario