HarperFast / HarperFast/harper

Add support for `Vary` response header in cache resolution

Open
#165 0 comments 0 reactions 1 assignee Claimed by @kriszyp View on GitHub
enhancement
Dominant language
JavaScript
Stars
89
Forks
10
Avg merge
2d 6h
Merged PRs (30d)
200

Description

### Feature Summary

Harper can handle `Response`s in cache resolution, facilitating general HTTP caching. However, there is no support for storing separate resource representations based headers listed in the `Vary` response header.

### Proposed Solution

The caching table will use an `alternates` field which can contain an array of alternate representations of the resource. When a `Vary` response header is received, the full key should be calculated from the indicated request headers, and the resolved body/data should be place in the alternates array if it is a new, or replace an existing entry if there is a matching one.
The request handling in Harper should also be able to detect the presence of alternates in the cache, and select the correct one.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.