Skip to content

Blade cache tag will be empty when disabled #12566

@helloiamlukas

Description

@helloiamlukas

Bug description

Expected Behaviour

If the cache tag is disabled, the content should be rendered uncached.

.env

STATAMIC_CACHE_TAGS_ENABLED=false

view.blade.php

    <statamic:cache scope="page">
        {{ now()->format('Y-m-d H:i:s') }}
    </statamic:cache>

This should always return the current time.

Actual Behaviour

If the cache tag is disabled, the content of the tag will be empty.

How to reproduce

  1. Create a new project: statamic new mysite statamic/starter-kit-cool-writings
  2. Change a view from antlers to blade (e.g. index.blade.php) and paste the following code:
    <statamic:cache scope="page">
        {{ now()->format('Y-m-d H:i:s') }}
    </statamic:cache>
  1. Add STATAMIC_CACHE_TAGS_ENABLED=false to the .env
  2. Open the edited view. The content of the cache tag will be empty.

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.x-dev Solo

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions