Open michalgwo opened 10 months ago
It looks like a Cache-Control HTTP header is needed to use this functionality. Otherwise it always uses a timeout of zero regardless of the set minimum tile update interval.
It looks like a Cache-Control HTTP header is needed to use this functionality. Otherwise it always uses a timeout of zero regardless of the set minimum tile update interval.
Is it supposed to be like that? Seems like this function is made to bypass configuration set by tileserver, but it doesn't in this case.
Yes, I think so. From the changelog:
Introduced
Source.minimumTileUpdateInterval
to override the expiration time set via HTTP headers with a longer expiration time on the client.
They keyword here is 'override'. There is nothing to override if no expiration time is present in the HTTP headers.
Describe the bug As MapTiler doesn't provide the Cache-Control HTTP response header for every tileset, I wanted to override it in the code in my Android app. What seems to be made for that is
Source.setMinimumTileUpdateInterval()
, but it doesn't seem to work. After setting this value to 14400000, the MapLibre still makes duplicate network requests every time I pan/zoom the map.To Reproduce Steps to reproduce the behavior:
https://api.maptiler.com/maps/openstreetmap/style.json?key={api_key}
(I don't know if it was on purpose or not, but I wrote to them about that, so they may update it in the future), you can get the free API key on maptiler.com[HTTP] Request was successful (code = 200).
[HTTP] This request was cancelled (request url)
It keeps requesting the same tiles every time you view this tile, so it seems like minimumTileUpdateInterval is 0.Expected behavior After setting minimumTileUpdateInterval to 14400000, MapLibre should keep tiles in the cache for 14400000 milliseconds and not make any more requests for the same tiles until this time passes
Platform information (please complete the following information):