-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
/cc @jfirebaugh |
Looks good! (For anyone else reviewing, the addition of Checking my understanding of how this will be used (c.f. #4844):
Is this right? The (minor) gap I see with this strategy is that in step 2, it looks like the |
Yeah, that was an oversight; sorry about that.
Yup, correct. Essentially it'll climb up the tile pyramid to see if something is in the cache without requesting from the internet that is not an ideal tile.
In step 2, it knows that the request is unfulfilled and can set |
Another potential approach would be to make the initial request
|
@jfirebaugh We need to transition the requests between |
Introduces "optional" requests. These should be fulfilled by the FileSource only there's a low-cost/easy way to obtain the data (e.g. from a local cache). If the data for an optional request cannot be found, it *must* return a Response object with a NotFound error. Traditional "required" requests still work the same way, with one change: If you set any prior* field in the Resource (i.e. priorModified, priorEtag, or priorExpires), the DefaultFileSource assumes that you already have the cache value and will not consult the cache before performing the request. If a prior cache lookup didn't turn up any data, and you therefore don't have an Etag or Modified value, you can still skip the cache by setting priorExpires. This will of course always result in a non-conditional HTTP request.
25f5c4e
to
8ee222c
Compare
Right now, when calling
FileSource::request()
, we're making every effort to obtain the data. However, for #123, we need a more relaxed way to request things that can be obtained with low effort (e.g. by loading it from a cache, but not downloading it from the internet).