Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http: dynamic responses for empty cache entries (#603)
If the cache entry for any given url was cleared, this would be indicated by a null entry for that url, and vere would serve a 404 for those cases, instead of falling back to the normal, dynamic behavior of injecting the request into eyre. Here, we make eyre serve from the cache only if there is a full cache entry for the url, and have it proceed into normal request injection logic otherwise. This way, setting a cached response for some url no longer means giving up dynamic responses on that url for the rest of time. Recent versions of eyre exhibit the same behavior. As such, in practice, this code won't change the observed behavior without a similarly-patched version of eyre. For that, see the sister PR, urbit/urbit#6909. The bulk of the updated logic in `_http_cache_respond()` comes from `_http_rec_accept()`, but due to differences in cache checking behavior it isn't a 1:1 match, so it seemed simplest for now to just duplicate the logic, rather than introduce another intermediary request handling function. Resolves urbit/urbit#6702.
- Loading branch information