Skip to content

feat: pass through cache-related headers and support conditional requ…#14

Open
cpilsworth wants to merge 2 commits into
adobe-rnd:mainfrom
cpilsworth:main
Open

feat: pass through cache-related headers and support conditional requ…#14
cpilsworth wants to merge 2 commits into
adobe-rnd:mainfrom
cpilsworth:main

Conversation

@cpilsworth

Copy link
Copy Markdown

Adds support for cache control and validation, fixing #13

  • Forward If-Modified-Since from client to origin and return 304 responses
  • Pass Date, Last-Modified, and Cache-Control from origin to client
  • Add test coverage for header pass-through behaviour

…ests

- Forward If-Modified-Since from client to origin and return 304 responses
- Pass Date, Last-Modified, and Cache-Control from origin to client
- Refactor header selection into shared pickHeaders() utility
- Add test coverage for header pass-through behaviour

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread src/index.ts Outdated
Comment on lines +23 to +24
const PASSTHROUGH_HEADERS = ['Date', 'Last-Modified', 'Cache-Control'];
const ORIGIN_REQUEST_HEADERS = ['If-Modified-Since'];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lets move these to the top before the first function

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