fix(index): add proxy-revalidate directive to cache-control#388
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds the proxy-revalidate Cache-Control directive to better disable caching in legacy shared proxies that don’t fully honor must-revalidate, aligning behavior with similar middleware like helmetjs/nocache.
Changes:
- Update the plugin’s
Cache-Controlheader value to includeproxy-revalidate. - Update the unit test expectation for the
cache-controlheader. - Update README header examples and rationale.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/index.js |
Adds proxy-revalidate to the default cache-control response header. |
test/index.test.js |
Updates expected header value; adjusts JSDoc types for matchObject. |
README.md |
Documents the new Cache-Control value and explains why proxy-revalidate is included. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
must-revalidatecovers both shared caches and private ones.However, some incredibly old legacy proxies, which i seem to encounter a lot of in the public sector, only partially implement this functionality and require
proxy-revalidatefor clearing shared-caches as well. >:(https://github.com/helmetjs/nocache already has this directive, probably for a similar reason.
Checklist
npm test