flalar
flalar

Reputation: 1221

Will hit-for-miss and hit-for-pass be removed from Varnish using BAN

Our cache-control headers only change during deploys of the application. Our current deployment pipeline triggers a BAN on the whole site to flush the cache after a successful deploy. Will this BAN also remove any hit-for-miss and hit-for-pass objects from Varnish? We’re currently using the default 120sec TTL for hit-for-miss, but considering cranking that up significantly if BAN (or PURGE) also removes those objects as things will never magically become cacheable without a deploy

Upvotes: 0

Views: 160

Answers (1)

Arianna Aondio
Arianna Aondio

Reputation: 171

  1. Banning, won't flush the cache, it will prevent content from being served and as a matter of fact it will ban content which will stay in cache untile TTL expires or until it gets hit by a request: https://docs.varnish-software.com/tutorials/cache-invalidation/

  2. Purging would be the best approach here

  3. Yes, banning will have effect on every single object you have in cache if you ban i.e. on "ReqURL ~ /"

Upvotes: 1

Related Questions