-
-
Notifications
You must be signed in to change notification settings - Fork 549
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
Using {{ nocache }}
around a form renders it once, but not on subsequent visits
#10890
Comments
I'm assuming it's related to this PR, but I could be wrong: #10306 |
{{ nocache }}
around a form renders it once, but not on subsequent visits{{ nocache }}
around a form renders it once, but not on subsequent visits
Yes, it'll be related to that PR. Out of curiosity, why are you wrapping the form in the |
We are seeing similar issues on sites with 5.27+... the issue is that the script is now being injected into the so its being run before anything in the has been rendered, therefore the query selector gets no nocache regions. This means nocache is basically broken on any full cached sites. |
Ugh yeah. Sorry about that. I'll revert that PR. |
No problem! Yeah, we use Happy to test anything you all need a hand with here—appreciate the quick response! |
Bug description
We have a Statamic 5.26.0 site that renders a form using code similar to the docs because we have enabled full static caching:
On page load the form is correctly AJAX'd in using the
{{ nocache }}
functionality.However, when I bump the version to 5.27.0 the form renders the first time, but after subsequent visits the form never loads again.
I'm not certain if it's related but the
{{ nocache }}
JS was at the end of the</body>
tag in 5.26.0, but moved to the<head>
in 5.27.0.How to reproduce
Logs
No response
Environment
Installation
Other (please explain)
Additional details
Uses a Statamic starter repo we developed in-house
The text was updated successfully, but these errors were encountered: