Skip to content

Etag support introduced in v5.68 is not compatible with nocache tags #13425

@mmodler

Description

@mmodler

Bug description

If a view uses nocache tags and there is a content change within such an area, the etag does not change. This is understandable, since $response->getContent() contains the following before and after the change, for example:

<span class="nocache" data-nocache=“6bd05a0d2de9b1b096bc36f02df6b6b11f2d66ec8966f7803fa0d043ececf49c88381b92”>NOCACHE_PLACEHOLDER</span>

Since the Etag does not change, clients (tested with Chrome) receive a 304 Not Modified response instead of the new content.

I think the bug was introduced with #11441

How to reproduce

  • Add a nocache tag with dynamic content to a template
  • Check etag in Frontened
  • Change the dynamic content displayed in the nocache tag
  • Check etag in Frontened again

Environment

Environment
Laravel Version: 11.47.0
PHP Version: 8.3.28

Statamic
Stache Watcher: Enabled
Static Caching: half
Version: 5.70.0 PRO

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions