-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Blade Directive @nocache
shows NOCACHE_PLACEHOLDER
#7820
Comments
I've ran into this one recently too. It happened to me when I had the {{ nocache }} tag present and had a form on the page but the static caching middleware wasn't present. |
After debugging and digging around I maybe stumbled on a solution. The Example placeholder method in VIewRegion: public function placeholder(): string
{
return view($this->view, $this->context);
} |
Pull request isn't working correct. Temp fix for now is: @if(in_array('statamic.web', Route::current()->gatherMiddleware()))
@nocache('auth.navigation-dropdown', [], [])
@else
@include('auth.navigation-dropdown', [], [])
@endif |
Closing in favour of #6744, which seems to be the same issue. |
Bug description
I'm using
@nocahe
blade directive for excluding auth dropdown. This give aNOCACHE_PLACEHOLDER
text in non statamic routes. In the comments of issue #6682 the tip is to addstatamic.web
middleware to the custom route.With that middleware the nocache placeholder is gone, but then the auth in other section of the page get cached. This is a problem with route that display user data.
User data on the frontend are laravel eloquent users.
How to reproduce
Example repo: https://github.com/jhhazelaar/laravel-statamic-nocache-placeholder
Set
STATAMIC_STATIC_CACHING_STRATEGY
tohalf
.Register two users in the application. Login and go to dashboard. Login second user and go to dashboard. See username of first user in dashboard.
Logs
No response
Environment
Installation
Existing Laravel app
Antlers Parser
None
Additional details
No response
The text was updated successfully, but these errors were encountered: