Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cache): added ability to control which response headers are stored #64

Closed
wants to merge 1 commit into from

Conversation

tompahoward
Copy link

What

Provides the cachedResponseHeaders configuration option, which can be used to adjust which HTTP response headers are stored in the cached and then populated in cached responses.

If the cachedResponseHeaders option is not provided, then a default set of headers are stored as per the existing behaviour, maintaining backwards compatibility.

To allow users to store headers in addition to the default set of headers, the default set of headers is available from mfh.CACHED_RESPONSE_HEADERS

Why

Some HTTP servers provide important response headers to clients that are not included in the set of headers that are stored in the cache, such as the HTTP Link header. Failure to include these headers in cached responses can break the clients that expect and use these headers.

References

Related to #62

@wraithgar
Copy link
Member

This is a great direction, thank you.

Can we move these into lib/options.js so that the defaults method can set them?

@nlf
Copy link
Contributor

nlf commented Apr 13, 2023

closing in favor of #225

@nlf nlf closed this Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants