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

Redis backend bypasses cache for resources lacking Vary headers #12

@cefn

Description

@cefn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions