Skip to content

Remove DECO_PAGE_CACHE_ENABLED env var — enable page cache by default#1157

Open
igoramf wants to merge 1 commit into
mainfrom
ft/remove-page-cache-enabled-env
Open

Remove DECO_PAGE_CACHE_ENABLED env var — enable page cache by default#1157
igoramf wants to merge 1 commit into
mainfrom
ft/remove-page-cache-enabled-env

Conversation

@igoramf

@igoramf igoramf commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removes the DECO_PAGE_CACHE_ENABLED env var requirement
  • Page caching for HTML responses is now always active (previously required DECO_PAGE_CACHE_ENABLED=true to opt-in)
  • DECO_PAGE_CACHE_CONTROL env var is still supported to customize the Cache-Control header value

Behavior unchanged

  • Responses with Set-Cookie headers are never cached (no-store, no-cache, must-revalidate)
  • Pages marked as dirty (PAGE_DIRTY_KEY) are not cached
  • Flags with cacheable !== true disable caching

Summary by cubic

Enable page caching for HTML responses by default. DECO_PAGE_CACHE_CONTROL still configures the Cache-Control header; caching still skips responses with Set-Cookie, dirty pages, and flags not marked cacheable.

  • Migration
    • Remove DECO_PAGE_CACHE_ENABLED from your environment and infra configs.
    • Set DECO_PAGE_CACHE_CONTROL to adjust caching behavior if needed.

Written for commit 4d403aa. Summary will update on new commits.

Summary by CodeRabbit

  • Chores
    • Streamlined page caching behavior by removing a configuration toggle, enabling more consistent cache header application for eligible HTML responses. This simplification may result in improved caching consistency.

@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Tagging Options

Should a new tag be published when this PR is merged?

  • 👍 for Patch 1.192.1 update
  • 🎉 for Minor 1.193.0 update
  • 🚀 for Major 2.0.0 update

@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 391de9c3-9a8e-4c5f-9060-4d6554686996

📥 Commits

Reviewing files that changed from the base of the PR and between 12bc007 and 4d403aa.

📒 Files selected for processing (1)
  • runtime/middleware.ts

📝 Walkthrough

Walkthrough

The PR removes the DECO_PAGE_CACHE_ENABLED environment variable toggle from the page-caching middleware logic. Cache-control headers now apply to HTML responses based solely on whether the page is dirty, eliminating the conditional enable/disable behavior.

Changes

Cohort / File(s) Summary
Page Cache Control Simplification
runtime/middleware.ts
Removed PAGE_CACHE_ENABLED environment toggle. Cache-control header now applies when !isPageDirty, regardless of the toggle. Only hasSetCookie and isPageDirty prevent caching behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • guitavano
  • hugo-ccabral

Poem

🐰 No toggle, no fuss, just the state of the page,
Dirty or clean, they both have their stage,
Cache control flows free, simplified and bright,
One less condition makes the code lean and light! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove DECO_PAGE_CACHE_ENABLED env var — enable page cache by default' directly and accurately reflects the main change: removing a conditional environment variable and enabling page caching by default.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ft/remove-page-cache-enabled-env

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

No issues found across 1 file

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