Reputation: 45943
We are interested in using a CDN (like Cloudflare) for our Rails 4 site (on Heroku), which has a form. Is it possible for the CDN to cache the form?
Each time a Rails form is rendered, it should have a unique authenticity token. So does that preclude it from being cached by a CDN? Are there any ways to make it work with a CDN?
Upvotes: 0
Views: 184
Reputation: 2087
CloudFlare caches by file extensions by default
If you're trying to cache something like yoursite.com/form, then you probably want to look at using PageRules to cache the actual page.
Note: I would recommend using caution if you use something like cache everything. You probably want to avoid having cached content intended for one user displayed to another user.
Upvotes: 1