Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 error on item view after first save - using static cache (half strategy) #9668

Open
jamie-b5 opened this issue Mar 5, 2024 · 2 comments
Labels

Comments

@jamie-b5
Copy link

jamie-b5 commented Mar 5, 2024

Bug description

We are using static caching. Half strategy.

When we add an item to a collection and hit save the front end item url throws a 404. It does this until we save the item a second time, at which point the url resolves to the correct record.

How to reproduce

  1. Enable static caching (half strategy)
  2. Create a new record in a collection
  3. Visit the url of the item (front end) - this shows a 404
  4. Save the record a second time
  5. Visit the url of the item - now works

Logs

No response

Environment

Environment
Application Name: Dave Whyte Animation
Laravel Version: 9.52.16
PHP Version: 8.1.21
Composer Version: 2.4.2
Environment: production
Debug Mode: OFF
URL: davewhyteanimation.com
Maintenance Mode: OFF

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

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 0
Antlers: runtime
Sites: 1
Stache Watcher: Disabled
Static Caching: half
Version: 4.52.0 PRO

Installation

Other (please explain)

Antlers Parser

None

Additional details

Statamic install - cloned from a slightly earlier repo then updated.

@chopperoon
Copy link

A client has also reported the same issue to us regarding their site also using half strategy caching.

@CjRootStudio
Copy link

CjRootStudio commented May 13, 2024

Bumping as I'm also experiencing the same issue on multiple sites. It seems to happen regardless of the caching strategy and save method. Either clicking the 'Save & Publish' button or hitting Cmd+S will result in a 404 unless saved a second time.

I'm able to replicate this issue consistently on sites running 4.45.0 up to 4.57.3.

Update: Setting the 'Max Depth' field to anything other than blank causes the issue, irrespective of eloquent or flat file. Keeping that field blank solves the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants