Cache breaking behaving differently all of a sudden #13126
Unanswered
thisanimus
asked this question in
Q&A
Replies: 3 comments
-
Can you share some of the template code within your |
Beta Was this translation helpful? Give feedback.
0 replies
-
What version were you coming from? Nothing was intentionally changed related to caching recently. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@brandonkelly We automate updates, so they have been incremental. I checked with the client they said this behavior has beed around for at least 3 weeks. @mmikkel here's an example: {# components/pageSections.twig #}
{% set sectionsQuery = entry.pageSections
.with([
'liveStream:boxcastChannel',
'announcements:announcementEntries',
'staffLeadership:people',
'sermons:individualSermons',
'feature:featureMedia',
'articles:ministries',
'articles:articles',
'pictureVideoGallery:media'
])
%}
{% for content in sectionsQuery.all() %}
{% if content.type.handle == 'announcements' and content.announcementEntries|length < 1 %}
{# dont show empty announcements blocks #}
{% else %}
{% set id = content.sectionTitle ? 'id="' ~ content.sectionTitle|kebab ~ '"' : '' %}
{% set classes = 'section ' ~ content.type ~ '-section ' ~ content.container %}
<section {{ id }} class="{{ classes }} {{ content.containerClasses ? content.containerClasses : '' }}">
{% if content.sectionTitle %}
<h2 class="section-title">{{ content.sectionTitle }}</h2>
{% endif %}
{% include "components/"~ content.type ~ "/_" ~ content.type ~ ".html" %}
</section>
{% endif %}
{% endfor %} {# components/announcements.twig #}
{% cache using key 'announcemnts-' ~ content.id ~ entry.id for 1 hour %}
{% set announcements = content.announcementEntries.with(['registration', 'media']).all() %}
{% if announcements|length %}
<ol class="announcements" data-count="{{ announcements|length }}">
{% for content in announcements %}
<li id="{{ content.slug }}">{% include "components/announcement/_announcement.html" with {count:announcements|length } %}</li>
{% endfor %}
</ol>
{% endif %}
{% endcache %} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We've had a Craft site for the last 4 years, initially on 3, since upgraded to 4. As of 4.4.7.1, it seems like cache breaking is behaving differently.
We have a matrix block where you can load in relations to other entries. Up to 4.4.7.1, if any of those related entries changed status (eg, go from inactive to active), the cache on current page would break, and you would see the updated content.
Now when that status changes, the cache does not get broken, even re-saving the "parent" page does not break the cache. If I make a change in that matrix block (eg, change the order of the related entries), then the cache breaks, and I see the correct related entries on the frontend.
Has anyone else experienced this? Is this working as intended?
Beta Was this translation helpful? Give feedback.
All reactions