Skip to content

Cache Tag will not be disabled in Live Preview #12553

@helloiamlukas

Description

@helloiamlukas

Bug description

Expected Behaviour

When using the cache tag, the content will not be cached during live preview.

<div>
     {{ cache }}
        {{ now format="Y-m-d H:i:s" }}
     {{ /cache }}
</div>

Actual Behaviour

When opening the live preview, the content of the cache tag will be cached.

How to reproduce

  1. Create a new project: statamic new mysite statamic/starter-kit-cool-writings
  2. Add the following line to resources/views/_footer.antlers.html:
<div>
     {{ cache }}
        {{ now format="Y-m-d H:i:s" }}
     {{ /cache }}
</div>
  1. Open an article in the control panel and open live preview (current date will be shown).
  2. Edit the article while live preview is opened (cached dated will be shown).

Logs

Environment

Environment
Application Name: Statamic
Laravel Version: 12.31.1
PHP Version: 8.3.22
Composer Version: 2.8.9
Environment: local
Debug Mode: ENABLED
URL: mysite.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file

Storage
public/storage: NOT LINKED

Statamic
Addons: 0
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.65.1 Solo

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

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