Skip to content

fix: cache invalidation cascade#107

Merged
trijpstra-fourlights merged 4 commits intomainfrom
fix/cache-invalidation-cascade
Nov 20, 2025
Merged

fix: cache invalidation cascade#107
trijpstra-fourlights merged 4 commits intomainfrom
fix/cache-invalidation-cascade

Conversation

@trijpstra-fourlights
Copy link
Contributor

This pr fixes the cache invalidation issues in #104.

Main problem was that the middleware didn't hook into the publish action, so that would always be out of date.

Other than that some small optimizations and refactoring.

Closes #104

@trijpstra-fourlights trijpstra-fourlights force-pushed the fix/cache-invalidation-cascade branch 2 times, most recently from 568f914 to c642330 Compare November 20, 2025 11:32
Remove API content-types (prefixed with "api::") from the resolved
relations dependencies array. These system-level content types should
not be included in the dependencies output.
@trijpstra-fourlights trijpstra-fourlights force-pushed the fix/cache-invalidation-cascade branch from c642330 to ecf0b9c Compare November 20, 2025 11:36
… entries

Add optional status parameter to refreshDependents function to allow
filtering cached entries by their status (draft, published) before
invalidation. This enables more granular cache invalidation based on
document status.
Extend cache invalidation logic to handle the "publish" action alongside
"update" actions. Refactor the refresh condition into a reusable variable
for consistency and maintainability. Add bustCache flag to populate service
and pass status parameter to refreshDependents to ensure proper cache
invalidation for all state transitions.
@trijpstra-fourlights trijpstra-fourlights force-pushed the fix/cache-invalidation-cascade branch from ecf0b9c to cd5d08e Compare November 20, 2025 11:37
@trijpstra-fourlights trijpstra-fourlights merged commit 0797da9 into main Nov 20, 2025
2 checks passed
@trijpstra-fourlights trijpstra-fourlights deleted the fix/cache-invalidation-cascade branch November 20, 2025 11:41
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.

Improve cache invalidation cascade

1 participant