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

Manual template cache management #1689

Closed
brandonkelly opened this issue May 3, 2017 · 1 comment
Closed

Manual template cache management #1689

brandonkelly opened this issue May 3, 2017 · 1 comment
Labels
enhancement improvements to existing features system administration 💼 features related to system administration
Milestone

Comments

@brandonkelly
Copy link
Member

The current template caching system has a high dosage of automagic cache busting:

  • {% cache %} tags record:
    • each of the element IDs whose properties were accessed (stored in templatecacheelements)
    • any element queries that were executed (stored in templatecachecriteria)
  • Whenever an element is saved/deleted, template caches will be deleted if:
    • they are associated with the element’s ID (via templatecacheelements)
    • any of the element queries associated with the template cache are now pulling in the element’s ID (via templatecachecriteria)

The element query-based cache busting works in general, but there are a few edge cases (e.g. #1667) where it doesn’t, and it is also generally a huge performance suck, and the cause of many stalled tasks. It’s so expensive that some sites resort to disabling it altogether, via the cacheElementQueries config setting.

We should probably just completely remove element query-based cache busting, and replace it with manual cache management, plus the ability to define automated cache busting strategies.

@brandonkelly brandonkelly added the enhancement improvements to existing features label May 3, 2017
@brandonkelly brandonkelly added the system administration 💼 features related to system administration label Mar 7, 2018
@brandonkelly brandonkelly added this to the 4.0 milestone Sep 25, 2019
brandonkelly added a commit that referenced this issue May 23, 2020
@brandonkelly
Copy link
Member Author

Element query caching has been completely rewritten for Craft 3.5, in a way that no longer suffers from the performance issues / long-runnning background jobs that have plagued {% cache %} tags to date. Details here: #1507 (comment)

@brandonkelly brandonkelly modified the milestones: 4.0, 3.5 Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improvements to existing features system administration 💼 features related to system administration
Projects
None yet
Development

No branches or pull requests

1 participant