Describe the bug
Hey there. I'm launching a Craft Cloud site tomorrow and getting past some final QA bugs.
Looks like https://PROJECT-NAME-production-5cd1c590.preview.craft.cloud/actions/formie/forms/refresh-tokens?form=footerSignup is a GET and returning a cache HIT. Craft Cloud is cached using CloudFlare.
I am on Formie version 2.1.17 and I don't see any changes in the changelog since related to refresh tokens. I am looking at the latest on v4: https://github.com/verbb/formie/blob/craft-4/src/controllers/FormsController.php#L371-L398
It looks like we need to add $this->response->setNoCacheHeaders(); More info from Craft on opting out of caching here: https://craftcms.com/knowledge-base/cloud-static-caching#opting-out
As a hotfix I've done this, we are using your Cached Forms Advanced Usage approach:
- fetch('/actions/formie/forms/refresh-tokens?form={{ form.handle }}')
+ fetch('/actions/formie/forms/refresh-tokens?form={{ form.handle }}&cache-workaround=' + Math.random())
Thanks so much!
Steps to reproduce
- setup site in craft cloud
- set to production mode so caching is enabled
- setup advanced usage style cached form
- submit form twice and get a CSRF error
Form settings
- Multi-page form: No
- Submission Method: Ajax
- Client-side Validation: Yes
- Custom Form Templates: No
Craft CMS version
4.10.2
Plugin version
2.1.17
Multi-site?
No
Additional context
No response
Describe the bug
Hey there. I'm launching a Craft Cloud site tomorrow and getting past some final QA bugs.
Looks like https://PROJECT-NAME-production-5cd1c590.preview.craft.cloud/actions/formie/forms/refresh-tokens?form=footerSignup is a GET and returning a cache HIT. Craft Cloud is cached using CloudFlare.
I am on Formie version 2.1.17 and I don't see any changes in the changelog since related to refresh tokens. I am looking at the latest on v4: https://github.com/verbb/formie/blob/craft-4/src/controllers/FormsController.php#L371-L398
It looks like we need to add
$this->response->setNoCacheHeaders();More info from Craft on opting out of caching here: https://craftcms.com/knowledge-base/cloud-static-caching#opting-outAs a hotfix I've done this, we are using your Cached Forms Advanced Usage approach:
Thanks so much!
Steps to reproduce
Form settings
Craft CMS version
4.10.2
Plugin version
2.1.17
Multi-site?
No
Additional context
No response