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

Function checkForCacheHeader

plugins/esi/esi.cc:1418–1437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1416}
1417
1418static bool
1419checkForCacheHeader(const char *name, int name_len, const char *value, int value_len, bool &cacheable)
1420{
1421 cacheable = true;
1422 if (Utils::areEqual(name, name_len, TS_MIME_FIELD_EXPIRES, TS_MIME_LEN_EXPIRES)) {
1423 if ((value_len == 1) && (*value == '0')) {
1424 cacheable = false;
1425 } else if (Utils::areEqual(value, value_len, "-1", 2)) {
1426 cacheable = false;
1427 }
1428 return true;
1429 }
1430 if (Utils::areEqual(name, name_len, TS_MIME_FIELD_CACHE_CONTROL, TS_MIME_LEN_CACHE_CONTROL)) {
1431 if (Utils::areEqual(value, value_len, TS_HTTP_VALUE_PRIVATE, TS_HTTP_LEN_PRIVATE)) {
1432 cacheable = false;
1433 }
1434 return true;
1435 }
1436 return false;
1437}
1438
1439static bool
1440addSendResponseHeaderHook(TSHttpTxn txnp, const ContData *src_cont_data)

Callers 3

fillPostHeaderMethod · 0.85
modifyResponseHeaderFunction · 0.85
maskOsCacheHeadersFunction · 0.85

Calls 1

areEqualFunction · 0.85

Tested by

no test coverage detected