Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Redis backend bypasses cache for resources lacking Vary headers #12

Open
cefn opened this issue Nov 12, 2018 · 1 comment
Open

Redis backend bypasses cache for resources lacking Vary headers #12

cefn opened this issue Nov 12, 2018 · 1 comment

Comments

@cefn
Copy link

cefn commented Nov 12, 2018

There's an issue with the ordering and truthy logic of !buffer at https://github.com/gitterHQ/request-http-cache/blob/master/lib/redis-backend.js#L19 in the Redis backend.

The result is that an empty string stored as a Vary header can never be retrieved, and given no Vary header coming back from the backend, the resource is then interpreted as having no cache, even when a cache is in fact stored in Redis at the proper location.

The empty-string has special meaning for request-http-cache - that there were no Vary headers when the resource was originally cached. Unfortunately that means that any resources not serving a Vary header can never be successfully retrieved from cache.

cefn added a commit to cefn/request-http-cache that referenced this issue Nov 12, 2018
This should fix the bug documented at gitterHQ#12 which ensures that all resources without Vary headers cannot be cached at all by the Redis backend.
@lalkhum
Copy link

lalkhum commented Nov 22, 2018

@suprememoocow Will this be approved in the near future or is this completely stopped from maintenance? Can you let us know please?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants