Add element-level opt-out for page caching - #3980
Open
robinboening wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3980 +/- ##
=======================================
Coverage 98.12% 98.12%
=======================================
Files 346 346
Lines 8971 8980 +9
=======================================
+ Hits 8803 8812 +9
Misses 168 168 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
robinboening
force-pushed
the
feature_element_level_page_cache_optout
branch
2 times, most recently
from
June 17, 2026 21:03
19a8a0b to
e5c19c5
Compare
tvdeyen
approved these changes
Jul 29, 2026
tvdeyen
left a comment
Member
There was a problem hiding this comment.
I like that feature. Would you mind to fix the remaining specs? We plan to make significant changes to the repo and this will break this PR. Also we plan to release 8.4 soon and we would include in that release
Allow element definitions to declare page_cache: false so pages that contain or can render those elements skip HTTP page-shell caching. Use no-store for this opt-out because no-cache still permits stored responses and conditional revalidation, which can return 304 before element-level cache variants are rendered. Keep the option as definition-only metadata and cover the new behavior with model and request specs.
tvdeyen
force-pushed
the
feature_element_level_page_cache_optout
branch
from
July 29, 2026 08:03
e5c19c5 to
8572837
Compare
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.
Closes #3973.
This adds a
page_cacheoption to element definitions, allowing individual elements to opt a page out of HTTP page caching:When a page contains an element definition with
page_cache: false, Alchemy now always renders the page instead of relying on the page-cache. This lets dynamic or permission-sensitive elements execute and apply their own fragment cache keys.The opt-out uses
Cache-Control: no-storerather than no-cache, because no-cache may still allow stored responses to be revalidated and return 304, which would skip rendering the element entirely.The option defaults to true and is kept as definition-only metadata, so existing element definitions and page cache behavior remain unchanged unless an element explicitly opts out.
Checklist