Any idea why this code wouldn’t update/break the cache when new items are created?
Think perhaps the combination of my code for pagination, cache and the ability to also break for pending entries isn't correct and throwing it off...
{#
# NEWS LISTING TEMPLATE
# ---------------
#}
{% extends "_layouts/main" %}
{# Get the most soonest upcoming pending entry for Cache breaking #}
{% set firstPending = craft.entries({
section: 'news',
status: 'pending',
order: 'postDate asc'
}).first %}
{% set cacheUntil = firstPending ? firstPending.postDate : now|date_modify('+1 year') %}
{% set entries = craft.entries({
section: 'news',
order: 'postDate desc',
limit: 6
}) %}
{# Get the articles and paginate them #}
{% paginate entries as pageInfo, pageEntries %}
{% block main %}
{% cache globally using key craft.request.path until cacheUntil %}
<div class="sitecontainer">
<h1 class="border-bottom">{{ entry.title }}</h1>
{% for entry in pageEntries %}
<article class="leading-normal mb-8">
<div class="sm:flex sm:items-center mb-8 pb-6 {% if not loop.last %}border-b border-grey-light{% endif %}">
<div class="bg-petrol relative text-lime p-4 sm:w-40">
<time datetime="{{ entry.postDate|date('Y-m-d H:i:s') }}" class=" text-center mb-0 relative z-30 text-sm">
<div class="mx-auto fill-current w-6 h-6 mb-2">
{% include '_includes/svg/icon-date.svg' %}
</div>
<div>
{{ helpers.dateFormatted(entry.postDate) }}
</div>
</time>
</div>
<div class="p-4 flex-1">
<h2 class="flex // flex-wrap items-center border-grey // text-base leading-normal font-semibold mb-1">
<a href="{{ entry.url }}">
{{ entry.title }}
</a>
</h2>
<p class="mb-0 text-base">
<a href="{{ entry.url }}" class="arrow font-normal text-lime hover:text-blue">view news</a>
</p>
</div>
</div>
</article>
{% endfor %}
</div>
{% endcache %}
{% include '_includes/partials/pagination' %}
{% endblock %}