Skip to content

Conversation

@reddy-vishwanath
Copy link
Contributor

@reddy-vishwanath reddy-vishwanath commented Oct 15, 2025

Summary by CodeRabbit

  • New Features
    • Added CloudFront cache tag header support (amzn-cache-tag) using the same deduplicated cache keys as other CDNs.
    • Edge-Cache-Tag is now emitted consistently across all providers, improving cache tagging reliability and purge workflows.
    • Cloudflare behavior remains unchanged, continuing to send Cache-Tag and Surrogate-Key alongside the unified tags.
    • Cache tag headers are standardized across providers to simplify configuration and enhance edge caching consistency.

@coderabbitai
Copy link

coderabbitai bot commented Oct 15, 2025

Walkthrough

The handler now always sets Edge-Cache-Tag regardless of CDN provider and adds CloudFront support by setting amzn-cache-tag with the same deduplicated cache keys. Existing Cloudflare headers (Cache-Tag, Surrogate-Key) are retained.

Changes

Cohort / File(s) Summary
CDN caching headers
server/handlers/cdn-caching.js
Removed provider gate for setting Edge-Cache-Tag; it is now always set. Added CloudFront header amzn-cache-tag populated with the same deduplicated cache keys. Retained Cloudflare headers (Cache-Tag, Surrogate-Key).
Package metadata
package.json
Bumped version from 7.34.5 to 7.34.6-amz-cache-tag.0. No other functional changes.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Client
    participant Handler as CDN Caching Handler
    participant Resp as HTTP Response

    Client->>Handler: Incoming request
    activate Handler

    Handler->>Handler: Compute & deduplicate cacheKeys
    note right of Handler #f2f4f8: Edge-Cache-Tag now provider-agnostic

    Handler->>Resp: Set header Edge-Cache-Tag: cacheKeys
    alt Cloudflare
        Handler->>Resp: Set header Cache-Tag: cacheKeys
        Handler->>Resp: Set header Surrogate-Key: cacheKeys
    end
    alt CloudFront
        Handler->>Resp: Set header amzn-cache-tag: cacheKeys
    end

    Handler-->>Client: Response with headers
    deactivate Handler
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • VeenaYemmiganur
  • nandap4790

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title “Amz cache tag” is overly terse and does not clearly summarize the key changes, such as unguarding the Edge-Cache-Tag header and adding the Cloudfront amzn-cache-tag header. It lacks context and uses an ambiguous abbreviation that may not be immediately clear to reviewers. Consequently, it fails to convey the primary purpose of the pull request in a concise, readable form. Please revise the title to clearly reflect the main change, for example “Add Cloudfront amzn-cache-tag header and remove CDN provider guard on Edge-Cache-Tag,” to provide immediate context and clarity for reviewers.
Description Check ⚠️ Warning No pull request description was provided, so all required sections from the repository template are missing, including a change summary, issue references, documentation links, type of change, testing details, and the checklist. Without any of this information, reviewers cannot assess the purpose, scope, or verification steps for the changes. Please populate the pull request description using the repository template by including a clear summary of the change, related issue and dependency references, documentation links, the type of change, testing instructions, and by completing the checklist to ensure all review criteria are covered.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch amz-cache-tag

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 12974b5 and 0d70296.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • package.json

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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