Skip to content

Static caching issue giving (partially) blank pages, possibly due to ETags #13876

@arthurperton

Description

@arthurperton

Bug description

I have a website in production running on Statamic v5. It hasn't had any updates to the code recently, but it does get updated periodically with a cronjob running composer update.

Recently we have been getting reports of visitors getting (partially) blank pages. Sometimes this is accompanied by the browser downloading a file named Unknown, zero bytes in size.
We're using static caching with the half strategy and clearing the static cache seems to (temporarily) solve the issue, but it can return quickly after a (few) reload(s).
I was able to reproduce the issue running v5.73.5.

An LLM told me that these symptoms might have to do with caching and ETags. I found recent changes with regard to ETags in releases 5.68 and 5.72.

So I decided to start with downgrading our Statamic version to v5.71.*. This seems to have solved the issue. So I think it might have to do with this PR which got merged in v5.72.

On a final note, the new code is also present in v6 and might cause issues there too.

How to reproduce

  1. Install the latest v5.x version
  2. Enable static caching, 'strategy' => 'half'
  3. Run out of luck

Logs

Environment

Environment
Laravel Version: 11.48.0
PHP Version: 8.3.28
Composer Version: 2.9.5
Environment: production
Debug Mode: OFF
Maintenance Mode: OFF

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

Drivers
Broadcasting: null
Cache: file
Database: mysql
Logs: daily
Queue: sync
Session: file

Statamic
Stache Watcher: Disabled
Static Caching: half
Version: 5.73.5 PRO

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