Proposal #1 sounds reasonable to me, although I would say that any CC header 
should take effect when enabled == 1, not just max-age but also any sort of 
no-store or similar "don't caching" value.  (Maybe that is what you already 
meant.)  I could also see having min and max lifetime values which get applied 
no matter what, which could replace having a different mode.  (and maybe the 
existing setting would be the max value.)  Then you would just have
if (enabled != 0)
  ttl = min(max(expires or CC calculated value, min value), max value);
(However note that my patch would also support ignore_server_no_cache, but 
maybe there should be a separate config just like that just but for negative 
caching.)

Should I still push my patch as an intermediate step?  If not I can just put it 
on the jira ticket and someone can take it as raw material.

Isn't TS-2633 indicating that 'current' isn't actually working right now?  I do 
see in the code that some of the code around negative_caching_lifetime is 
looking to see if there is an EXPIRES header...but not checking for a CC 
header...which is odd, but also means that 'current' isn't really what it does 
now.

-William Bardwell
________________________________________
From: Yongming Zhao <ming....@gmail.com>
Sent: Tuesday, January 27, 2015 9:29 PM
To: dev@trafficserver.apache.org
Subject: negative expire time

well, TS-3331 TS-2633 all talking about negative caching issues, during the 
change, I’d proposal a more adaptable change for your comments:


The negative cache is causing some confusion when it is cached by accident, the 
current state machine working as:

===current===
if expire time set(by Expire or CC-maxage)
 then set expire time according to origin server response.
else
 if http.negative_caching_enabled = 1 ( which default to 0 )
    then set expire time to http.negative_caching_lifetime ( which default to 
1800s )
 else
    no cache



when some origin server in trouble, there will be very common case to get some 
negative response with expire time set, and long expire time as 200 responses 
maybe. that will give us trouble when we running in CDN service.
so there should make some change on that state machine to make a forced expire 
time when ATS get a negatived response from origin:

===proposal #1===
case http.negative_caching_enabled = 0 ( which default to 0 )
 no cache at all ( that is, remove the expiretime even it have )
case http.negative_caching_enabled = 1
 if expire time set(by Expire or CC-maxage)
   then set expire time according to origin server response.
 else
   set expire time to http.negative_caching_lifetime ( which default to 1800s )
case http.negative_caching_enabled = 2
 then set expire time to http.negative_caching_lifetime to all ( mostly we 
should set a very short expire time here )


well, a modified version that will compatible with current codes, we force all 
the expire time to negative_caching_lifetime if http.negative_caching_enabled = 
2

=== proposal #2===
if expire time set(by Expire or CC-maxage)
  if http.negative_caching_enabled = 2
    then set ALL negative response expire time to 
http.negative_caching_lifetime ( mostly we should set a very short expire time 
here )
  else
    then set expire time according to origin server response.
else
  if http.negative_caching_enabled > 0 ( which default to 0 )
    then set expire time to http.negative_caching_lifetime ( which default to 
1800s ) ### this set no expire time negative to 1800s, mostly we should set a 
very short expire time here
  else
    no cache



thanks for your comments


- Yongming Zhao 赵永明

Reply via email to