[PATCH] backend conditional requests first release

Geoff Simmons geoff at uplex.de
Fri Mar 4 00:41:12 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 3/2/11 9:55 PM, Dmitry Panov wrote:
> 
> Another thing I've noticed is that beresp.ttl appears to be -1 in
> vcl_fetch after a successful validation request (i.e. the one responded
> with 304). With my vcl (which I took from the distribution) it causes
> the object to be marked as hit_for_pass.
> 
> I've added beresp.status != 304 to prevent this but I think it would be
> better if ttl was set as if the object was retrieved in full. In my case
> it would be the default ttl as the backend does not provide any.

I quite agree with you, beresp.ttl after a 304 response should be the
TTL calculated for the newly created object.

@phk: The problem here is that cnt_fetch() sets the TTL to -1 just
before the call to VCL_fetch_method() if the response code was 304. The
code is closely following the RFC here, and only retains the computed
TTL for response codes listed in Ch. 13.4.

I think the best solution is just to add 304 to the cases that don't
cause TTL to be set back to -1. I've tested that, and all of the
regression tests pass, including the new ones for IMS. Varnish would
only get a 304 from the backend if it submitted a conditional request
(unless the backend is broken), so we're in control of what's happening.

Would you go along with that?


Best,
Geoff
- -- 
UPLEX Systemoptimierung
Schwanenwik 24
22087 Hamburg
http://uplex.de/
Mob: +49-176-63690917
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJNcCcYAAoJEOUwvh9pJNURHpcQAI5pwuaWcvveMKB+EQ/6hhDe
wNlAoDDm2PDtUMBbv/wvB8PHTyroTNvJf+rY3FATcCV4YQwPzDzDQ0VruRd3K4WW
mdkt35d2KiTLBwi5Ufmo5WrdPKZMyFzzBndWWuIZfkmALJL17uKPtqcM05ZkAglI
GyYEyrEC0/009ojuqJm5U1t0hRlwkjrfqU2felOryvn6FDYPcNog61zPl+7f1CdR
QVC5AQm1TfZVxeOxJdAbRNP/H1wRCJf7DpXR6VVDqlkFIjQyNdr1aMZbXeZSztNq
xJOkMViLongpxE+IhIccHcx5PvcbmW5JQDo6gixqic0ntLnzmAHst6Pig8KET/go
+EH0hAVTTgvbBpWtn8oxTObVPtqj71j2YBbPGk1qnRisQ7XaxavHDN6PcDi21Xr1
Xp7qo4iIiGX0HD5Qe2TKZ6h+MW5HEnOwxPrA5Xe5IMc2SNthqSbimND4zWxjWDuS
RB7wemhQgBhPeENVOdyCAnllXwv1mLJSPLnOt0ok5dH6+3nd8uZhlAUUlhlz9Zhm
2EBOiyV/yoVUZCdJEOLZL7GvFhN9VfrARp6pWlwN/mTwUan7WH3uxHn/XY1naI/2
uFXA8UvQzlxVJHPFyc/BONkQquUIsHtEh1JYHC8YUhrNYWbzRHEegHeyReLqOfHG
MJeQ7SYPGOHA+uHohr51
=GQMC
-----END PGP SIGNATURE-----




More information about the varnish-dev mailing list