This repository was archived by the owner on Aug 8, 2023. It is now read-only.
have a more explicit Response representation for "304 Not Modified" - #3516
Merged
Merged
Conversation
Member
|
This gets unlocked when #2826 is landed (for coalescing, we need to keep the response around anyway). |
Contributor
Author
Contributor
|
LGTM |
jfirebaugh
force-pushed
the
simplify-cache
branch
from
January 14, 2016 20:54
a9a3dd2 to
891e27f
Compare
There is only one implementation and we're unlikely to add more.
jfirebaugh
force-pushed
the
simplify-cache
branch
from
January 14, 2016 21:46
891e27f to
0066637
Compare
jfirebaugh
referenced
this pull request
Jan 14, 2016
We're now supporting using stale TileJSON and GeoJSON data. When we receive a new answer with an updated TileJSON file, we're replacing the Source's metadata with the new one and trigger updates to make sure we're loading the correct tiles. Similarly, GeoJSON data will be reparsed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the way that a 304 Not Modified response gets encoded into
Responseis that thestd::shared_ptr<const std::string>data from the previous response is copied into the new one. This requires a subtle invariant to be preserved byOnlineFileSource, the resulting pointer equality comparisons can be mistaken for a bug, and it means that the raw response body must remain in memory in addition to any parsed representation.Instead, we should have a way for a 304 Not Modified response to be more explicitly encoded into
Response, and consumers should only have to maintain the etag and expires values to make a revalidating request and check if things changed.cc @kkaefer @tmpsantos