If the browser sends a req for the same page again to the cache, then the "if
modified since" header of the req is compared with the "date" of the object in
cache. In case the cache object is not newer than the IMS header, then the
cache returns 304, so that we avoid further data transfer between cache and
browser. The browser in this case would simply read from its own cache.
I have come up with this solution. My basic idea is the following addition to
vcl in sub vcl_hit().
if (req.http.If-Modified-Since &&
obj.http.Date) {
//if (obj.http.Date <= req.http.If-Modified-Since) {
// error 304 "Not
Modified";
//} }
I understand I can not use "<=", so I have gone ahead and used the
corresponding inline C code to convert the http headers into string
using VRT_GetHdr and strprintf/scanf funcs. However, now I am trying to
figure out a way to implement the VCL error using inline C. Is that possible?
Thanks.
Thanks,
Neel
On Fri, 01 Oct 2010 13:13:38 +0530 Ask Bjørn Hansen wrote
>
>On Sep 30, 2010, at 22:40, Indranil Chakravorty wrote:
>
>> Thanks,
>> I am now trying to figure out how to get the date time stamp from an
object in cache, so that I could use it to compare with the IMS header of the
request from browser. Any idea/ pointers? Thanks.
>
>What are you trying to do?
>
>
> - ask
>
> _______________________________________________
varnish-dev mailing list
[email protected]
http://lists.varnish-cache.org/mailman/listinfo/varnish-dev