Skip to content

Conversation

@duncanmcclean
Copy link
Member

This pull request fixes an issue caused by #12929, where the nocache tag wasn't replacing the <span class="nocache"> element as expected.

In my testing, this PR seems to fix both issues, in addition to supporting shadow root elements (which the previous PR added support for).

This is the template I was testing with:

{{ nocache }}
    <p class="mb-6">only element</p>
{{ /nocache }}

<ul class="flex items-center mb-6">
    {{ nocache }}
        {{ nav:header }}
            <li>
                <a class="py-1.5 px-3 rounded-md {{ if is_current }} bg-white font-medium {{ else }} text-blue-600 hover:bg-white {{ /if }}" href="{{ url }}">{{ title }}</a>
            </li>
        {{ /nav:header }}
    {{ /nocache }}
</ul>

{{ nocache }}
    <div>
        <template shadowrootmode="open">...</template>
    </div>
{{ /nocache }}

Fixes #13114
Fixes #13141

@jasonvarga jasonvarga merged commit a077670 into 5.x Nov 30, 2025
26 checks passed
@jasonvarga jasonvarga deleted the nocache-js branch November 30, 2025 21:55
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.

Script tags are not evaluated inside nocache tags when using full-measure caching Since v5.69 nocache Tags are not _replaced_ but kept in the markup

3 participants