Commit Graph

6 Commits

Author SHA1 Message Date
Konstantin Käfer
f281e6ae8a [core] fix loading of stale must-revalidate resources
In https://github.com/mapbox/mapbox-gl-native/pull/9670, we implemented support for the Cache-Control: must-revalidate header. While we now respect this header and don't show resources that are stale and have this header set, the optional cache request never completes. This means we're also never going to try to actually get a fresh tile and just never show this tile anymore.

This commit fixes this by responding with a Not Found error when the resource is unusable (= stale and has must-revalidate set). Since we actually still have the data (but can't use it due to caching rules), we're responding with the data as well. To avoid a second cache hit, tile_loader_impl.hpp now passes on the data from the Optional to the Required request so that it can be reused when we get a 304 Not Modified response from the server.
2017-09-25 10:47:20 +02:00
Konstantin Käfer
f0a7c45064 [core] finish must-revalidate support 2017-08-08 12:40:38 +02:00
Thiago Marcos P. Santos
ea34cb5725 [core] Use the ResourceTransform instead of callbacks
Based on the actor model, can be considered safer to use since
we don't need to worry about object lifetime anymore.
2017-06-26 16:32:21 +03:00
Jesse Bounds
e1546644b5 [core] Cache file source base URL and access token
This caches the base URL and access token values when they are set
so that they can still be retrieved even when the thread is paused.
2017-03-01 08:25:44 -08:00
Konstantin Käfer
f0ec9fb74b [test] add unit test for DefaultFileSource::setResourceTransform() 2017-02-20 14:36:27 +01:00
Konstantin Käfer
3f3fc7b772 [test] add .test.cpp suffix to test case files 2016-09-28 16:34:22 +02:00