MCPcopy Create free account
hub / github.com/apache/trafficserver / is_negative_caching_appropriate

Function is_negative_caching_appropriate

src/proxy/http/HttpTransact.cc:577–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575int response_cacheable_indicated_by_cc(HTTPHdr *response, bool ignore_no_store_and_no_cache_directives);
576
577inline static bool
578is_negative_caching_appropriate(HttpTransact::State *s)
579{
580 if (!s->txn_conf->negative_caching_enabled || !s->hdr_info.server_response.valid()) {
581 return false;
582 }
583
584 int status = s->hdr_info.server_response.status_get();
585 auto params = s->http_config_param;
586 if (params->negative_caching_list[status]) {
587 TxnDbg(dbg_ctl_http_trans, "%d is eligible for negative caching", status);
588 return true;
589 } else {
590 TxnDbg(dbg_ctl_http_trans, "%d is NOT eligible for negative caching", status);
591 return false;
592 }
593}
594
595inline static ResolveInfo::UpstreamResolveStyle
596find_server_and_update_current_info(HttpTransact::State *s)

Calls 2

validMethod · 0.45
status_getMethod · 0.45

Tested by

no test coverage detected