cms icon indicating copy to clipboard operation
cms copied to clipboard

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

Open arthurperton opened this issue 9 months ago • 4 comments

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

arthurperton avatar Feb 10 '26 08:02 arthurperton

Looks like https://github.com/statamic/cms/pull/13654 was attempting to fix something related. But if you're still experiencing this on 5.73.5 then there must be more to it.

jasonvarga avatar Feb 10 '26 15:02 jasonvarga

Can confirm this (latest v5 version), had to disable the static caching strategy (also half) to fix some statamic websites. Really sucks! As this breaks everything - interesting enough, it always downloads empty file for us when this happens.

BALOTIAS avatar Feb 13 '26 09:02 BALOTIAS

For us the issues are gone since the downgrade four days ago.

If I remember correctly, the empty file download happened consistently on Safari. I don't think it happened in Chrome..

arthurperton avatar Feb 13 '26 13:02 arthurperton

I'm going to revert the etag PRs for now.

jasonvarga avatar Feb 13 '26 22:02 jasonvarga