<div dir="ltr">You could vary on the Etag which will keep multiple Etag versions in cache while allowing for 304 responses on each one:<div><br></div><div>---<br><div><br></div><div><div><font face="monospace, monospace">vcl 4.0;</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">backend default</font></div><div><font face="monospace, monospace">{</font></div><div><font face="monospace, monospace">  .host = "127.0.0.1";</font></div><div><font face="monospace, monospace">  .port = "80";</font></div><div><font face="monospace, monospace">}</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">sub vcl_recv</font></div><div><font face="monospace, monospace">{</font></div><div><font face="monospace, monospace">  if (req.http.If-None-Match) {</font></div><div><font face="monospace, monospace">    set req.http.ETag = req.http.If-None-Match;</font></div><div><font face="monospace, monospace">  }</font></div><div><font face="monospace, monospace">}</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">sub vcl_backend_response</font></div><div><font face="monospace, monospace">{</font></div><div><font face="monospace, monospace">  set beresp.http.Vary = "ETag";</font></div><div><font face="monospace, monospace">}</font></div></div><div><font face="monospace, monospace"><br></font></div>---</div><div><br></div><div>I may have misunderstood the question, but your backend would have to return the correct response matching upto the Etag.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">--<br>Reza Naghibi<br>Varnish Software</div></div></div>
<br><div class="gmail_quote">On Mon, Jan 23, 2017 at 10:02 AM, Craig Servin <span dir="ltr"><<a href="mailto:cservin-varnish@cromagnon.com" target="_blank">cservin-varnish@cromagnon.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jan,<br>
<br>
You might want to consider using the libvmod-xkey and then having backend changes just tell varnish to invalidate based on that secondary key.<br>
<br>
Cheers,<br>
<br>
Craig<span class="im HOEnZb"><br>
<br>
<br>
<br>
On 2017-01-23 06:56, Jan Hugo Prins | BetterBe wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
We are currently investigating the use of Varnish for our<br>
infrastructure. In the software we build, we depend on the<br>
If-None-Match header and the use of ETAG's.<br>
The API we have created creates mainly JSON objects, and they differ<br>
in size from a few hundreds of bytes to several megabytes. A lot of<br>
these JSON objects are perfectly suited for caching, until someone<br>
changes a parameter and this can happen at any moment. That is also<br>
why we keep a record of all ETAG's and we invalidate them when needed.<br>
<br>
<br>
What we would like to do is cache created JSON object in front of our<br>
production environment and when someone requests the same calculation<br>
that someone else has requested before and the ETAG is still valid,<br>
send out the cached object. But this basicly implies the following<br>
workflow:<br>
</blockquote>
<br>
<br></span><div class="HOEnZb"><div class="h5">
______________________________<wbr>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/varnish<wbr>-misc</a><br>
</div></div></blockquote></div><br></div>