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

{nocache} tag and 404 pages #6543

Closed
ryanmitchell opened this issue Aug 22, 2022 · 3 comments · Fixed by #6838
Closed

{nocache} tag and 404 pages #6543

ryanmitchell opened this issue Aug 22, 2022 · 3 comments · Fixed by #6838
Labels

Comments

@ryanmitchell
Copy link
Contributor

Bug description

Using {nocache} in a layout means that on 404 pages we see a lot of {NOCACHE_PLACEHOLDER} being output instead of what we wanted not to be cached.

It seems the middleware is not being run?

How to reproduce

Add {nocache} to your layout and hit a 404 page on your install.

Logs

No response

Environment

Statamic 3.3.29 Pro
Laravel 8.83.23
PHP 8.1.7
aerni/social-links 2.3.1
cnj/seotamic 2.0.6
doublethreedigital/duplicator 2.3.1
mitydigital/iconamic 1.0.2
pecotamic/sitemap 1.4.0
thoughtco/statamic-minify 1.1.1
thoughtco/statamic-redirects 1.1.0

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

runtime (new)

Additional details

No response

@jasonvarga
Copy link
Member

Confirmed.

@mikemartin
Copy link

Just hit this one myself

@stuartcusackie
Copy link

stuartcusackie commented Oct 5, 2022

Me too. Would be nice if the nocache tag just fell back to the partial when static caching isn't available, but that's apparently more complicated than it seems. ##6744

Also, weirdly it seems the statamic.web middleware is being applied to my error pages so I don't understand why NO_CACHE_PLACEHOLDER is being shown:

@dump(Route::current()->gatherMiddleware())

^ array:2 [▼
  0 => "web"
  1 => "statamic.web"
]

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

Successfully merging a pull request may close this issue.

5 participants