You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2020/12/21 06:30:49 UTC

[GitHub] [trafficserver] masaori335 commented on a change in pull request #7401: Fix unnecessary addition of Expires header

masaori335 commented on a change in pull request #7401:
URL: https://github.com/apache/trafficserver/pull/7401#discussion_r546531334



##########
File path: proxy/http/HttpTransact.cc
##########
@@ -4464,7 +4464,7 @@ HttpTransact::handle_cache_operation_on_forward_server_response(State *s)
     //   before issuing a 304
     if (s->cache_info.action == CACHE_DO_WRITE || s->cache_info.action == CACHE_DO_NO_ACTION ||
         s->cache_info.action == CACHE_DO_REPLACE) {
-      if (s->is_cacheable_and_negative_caching_is_enabled) {
+      if (s->is_cacheable_and_negative_caching_is_enabled && is_negative_caching_appropriate(s)) {

Review comment:
       I worry about `s->is_cacheable_and_negative_caching_is_enabled` is not set correctly in line 4405. Prior to the 8eb68266167d8f8b3fa3a00ca9f6b7889e8ec101, when this function set `s->is_cacheable_and_negative_caching_is_enabled` (renamed from `s-> negative_caching`), it called `is_negative_caching_appropriate(s)`. Should we roll it back? 
   ```
   4405 -      s->negative_caching = is_negative_caching_appropriate(s) && cacheable;
   4405 +      s->is_cacheable_and_negative_caching_is_enabled = cacheable && s->txn_conf->negative_caching_enabled;
   ```
   https://github.com/apache/trafficserver/commit/8eb68266167d8f8b3fa3a00ca9f6b7889e8ec101#diff-7f286e5169bc2d28c13f1ceaf3bb482b36cdb0743fbac4040fd4cd5a9c0897c1L4405-R4405
   
   /cc @bneradt 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org