<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Invalidation on Varnish Cache</title><link>https://www.varnish.org/docs/tutorials/tags/invalidation/</link><description>Recent content in Invalidation on Varnish Cache</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 31 Aug 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://www.varnish.org/docs/tutorials/tags/invalidation/index.xml" rel="self" type="application/rss+xml"/><item><title>Banning content from Varnish</title><link>https://www.varnish.org/docs/tutorials/ban/</link><pubDate>Tue, 31 Aug 2021 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/tutorials/ban/</guid><description>&lt;p&gt;&lt;em&gt;Banning&lt;/em&gt; is a concept in &lt;em&gt;Varnish&lt;/em&gt; that allows &lt;em&gt;expression-based cache invalidation&lt;/em&gt;. This means that you can invalidate multiple objects from the cache without the need for individual &lt;a href="https://www.varnish.org/docs/tutorials/purge/"&gt;purge&lt;/a&gt; calls.&lt;/p&gt;
&lt;p&gt;A &lt;em&gt;ban&lt;/em&gt; is created by adding a &lt;em&gt;ban expression&lt;/em&gt; to the &lt;em&gt;ban list&lt;/em&gt;. All objects in the cache will be evaluated against the expressions in the &lt;em&gt;ban list&lt;/em&gt; before being served. If the object is banned Varnish will mark it as expired and fetch new content from the backend.&lt;/p&gt;</description></item><item><title>Purging content from Varnish</title><link>https://www.varnish.org/docs/tutorials/purge/</link><pubDate>Mon, 30 Aug 2021 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/tutorials/purge/</guid><description>&lt;p&gt;The most basic and easy-to-use &lt;em&gt;cache invalidation mechanism&lt;/em&gt; in Varnish is &lt;em&gt;purging&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The idea is that you can perform a &lt;code&gt;return (purge)&lt;/code&gt; in &lt;code&gt;vcl_recv&lt;/code&gt;, and &lt;em&gt;Varnish&lt;/em&gt; will remove the object. This would free up space in the cache after an object lookup.&lt;/p&gt;
&lt;p&gt;This means that the &lt;em&gt;hash&lt;/em&gt; of the object is used to identify it, but &lt;code&gt;return (purge)&lt;/code&gt; would remove it along with its variants. This isn&amp;rsquo;t &lt;em&gt;out-of-the-box&lt;/em&gt; behavior; you won&amp;rsquo;t find it in the &lt;em&gt;built-in VCL&lt;/em&gt;. You need to write some VCL code for it.&lt;/p&gt;</description></item><item><title>Cache invalidation</title><link>https://www.varnish.org/docs/tutorials/cache-invalidation/</link><pubDate>Wed, 20 May 2020 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/tutorials/cache-invalidation/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;A good caching strategy not only defines how the content should be cached, but most importantly, how it should be invalidated and evicted from cache.
An object inserted in cache can be served to other clients until it expires, is evicted to make room for other objects, or is invalidated.&lt;/p&gt;
&lt;p&gt;The TTL (Time to Live) of an object define how long an object can be cached. An object&amp;rsquo;s TTL is set when the content is generated (by the backend) or when it&amp;rsquo;s inserted (in Varnish).
The TTL can be set via HTTP caching headers (i.e. &lt;code&gt;Expires&lt;/code&gt; or &lt;code&gt;Cache-Control&lt;/code&gt;) or via VCL.
Either way, Varnish will respect the defined TTLs and evict the object when its Time to Live has expired, making room for fresher content to be inserted in cache.&lt;/p&gt;</description></item></channel></rss>