Django's CsrfViewMiddleware sets "Vary: Cookie" header, that means that cache system will take into account not only page URL but also user's Cookies that are unique for each user. So pages don't cache once for all users, but for each user. And in my case I have very loaded site, and such behaviour does not satisfy me.
- Do I have right view on this issue, or I'm wrong?
- Can I turn off setting "Vary: Cookie" header without turning off CSRF protection?
Vary: Cookie
basically allows any site to bypass your CSRF protection, because they have the same token as the victim. – Outhaul