moonchen commented on code in PR #13417:
URL: https://github.com/apache/trafficserver/pull/13417#discussion_r3770143634


##########
src/proxy/http/HttpTransact.cc:
##########
@@ -3059,6 +3062,7 @@ HttpTransact::build_response_from_cache(State *s, 
HTTPWarningCode warning_code)
     obj = s->cache_info.object_read;
   }
   cached_response = obj->response_get();
+  set_cache_freshness_info(s, cached_response, obj->request_sent_time_get(), 
obj->response_received_time_get(), true);

Review Comment:
   `what_is_document_freshness()` computes the age for this same object from 
`s->request_sent_time`/`s->response_received_time`, which are clamped with 
`std::min(s->client_request_time, ...)` at lines 2687-2688 and 3372-3373, and 
it then clamps `current_age` into `cache_guaranteed_max_lifetime`. Here the 
object's raw times are used, so `cca` can be a different number than the age 
that decided FRESH vs STALE. Deliberate? If so it would help to say in the doc 
which one `cca` is.
   
   Note this also runs with `obj = &s->cache_info.object_store` on the 
`api_update_cached_object == CONTINUE` branch above, where the object came from 
a plugin.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to