0

I'd like to exclude certain pages from the Varnish cache based on the content of the page (for instance if the Form uses a particular hidden field which is a security feature and needs to be unique on every page refresh).

I have dozens of forms, so I don't want to have to exclude each unique page individually from the cache.

Is this possible within the VCL?

1 Answers1

1

No, normally not. The proper way to do it would be to set cache-headers (for instance "Cache-Control: no-cache, must-revalidate") on your pages with the non-cacheable forms that varnish in turn will read.

As a nice side effect that will also cancel most client side caches that also often can cause troubles with CAPTCHAs and the like.

Clarence
  • 2,944
  • 18
  • 16