Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved invalidation #39

Merged
merged 28 commits into from
May 10, 2024
Merged

Improved invalidation #39

merged 28 commits into from
May 10, 2024

Conversation

timkelty
Copy link
Collaborator

@timkelty timkelty commented Apr 22, 2024

Description

  • Cache tags are now collected starting with \craft\web\Application::EVENT_INIT and ending with \yii\web\Response::EVENT_AFTER_PREPARE. This allows the default caching beyond template rendering.
  • Provide methods to add/remove arbitrary tags
  • Provide methods to purge arbitrary tags
  • Ensures invalidation occurs when saved via CLI or Web
  • Invalidate URIs on element save and delete. This helps account for cached 404 responses not being cleared for new entries. Can move to Elements::EVENT_INVALIDATE_CACHES after Pass element to InvalidateElementCachesEvent cms#14950
  • Need to prevent resave/entries from trigging a flood of invalidation requests (one per element)
    • Craft 5 could use bulk op events

Related

@timkelty timkelty self-assigned this Apr 22, 2024
@timkelty timkelty requested a review from brandonkelly April 22, 2024 15:27
@timkelty timkelty merged commit bdc3155 into 1.x May 10, 2024
5 checks passed
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.

1 participant