Caching POST data with Varnish
summary
Caches POST search requests for repeatable AJAX Views and Drupal Commerce flows by installing Varnish 5 (unstable) and compiling the body_access module, then adding a few VCL lines to include method and body data in the hash (grabs ~10–100KB). Works by differentiating GET vs POST on identical URLs and hashing body or a custom header; corner cases include collisions if relying only on Content-Length. Recommended fix: add a client-side MD5 or unique header and include it in the hash so cached responses match the exact POST payload.
AI-written summary · about
related talks
28mCaching the uncacheable in Varnish
56mCaching the uncacheable in Varnish
58mCaching the uncacheable: delivering personalized experiences without sacrificing performance
46mVarnish for PHP developers
28mTaking Laravel to the edge with HTTP caching & Varnish
38mHTTP Headers that Make Your Website Go Faster
37mVarnish tips & tricks
38mThe power of cache in a slow world
