Skip to content

fix(index): add proxy-revalidate directive to cache-control#388

Merged
Fdawgs merged 1 commit intomainfrom
fix/proxy-revalidate
Mar 2, 2026
Merged

fix(index): add proxy-revalidate directive to cache-control#388
Fdawgs merged 1 commit intomainfrom
fix/proxy-revalidate

Conversation

@Fdawgs
Copy link
Copy Markdown
Owner

@Fdawgs Fdawgs commented Feb 27, 2026

must-revalidate covers 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-revalidate for clearing shared-caches as well. >:(

https://github.com/helmetjs/nocache already has this directive, probably for a similar reason.

Checklist

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-Control header value to include proxy-revalidate.
  • Update the unit test expectation for the cache-control header.
  • 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.

Comment thread test/index.test.js
@Fdawgs Fdawgs merged commit 9c3b164 into main Mar 2, 2026
22 of 23 checks passed
@Fdawgs Fdawgs deleted the fix/proxy-revalidate branch March 2, 2026 14:25
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.

2 participants