<br><div class="gmail_quote">On Fri, Oct 21, 2011 at 7:38 PM, S Ahmed <span dir="ltr"><<a href="mailto:sahmed1020@gmail.com">sahmed1020@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
WHen a page gets cached in varnish, is it possible to have some sort of html flag so by looking at the html you can see when it was cached in varnish?<div><br></div><div>e.g.</div><div><br></div><div><br></div><div><!-- varnish cached at 20111021 5:44pm --></div>
<div><br></div><div>I'm using ruby on rails.</div>
<br>_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br></blockquote></div><div><br></div><br><div><div>sub vcl_deliver {</div>
<div>if (obj.hits > 0) {</div><div>set resp.http.X-Cache = "HIT";</div><div>} else {</div><div>set resp.http.X-Cache = "MISS";</div><div>}</div></div><div>}</div><div><br></div><div>Check the header of the elements (html or jpg or gif, etc) on your website, u will see something as...</div>
<div><br></div><div>X-Cache<span class="Apple-tab-span" style="white-space:pre"> </span>HIT</div><div>or</div><div>X-Cache<span class="Apple-tab-span" style="white-space:pre"> </span>MISS</div>