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

Function CheckCacheable

plugins/generator/generator.cc:735–746  ·  view source on GitHub ↗

Little helper function, to turn off the cache on requests which aren't cacheable to begin with. This helps performance, a lot.

Source from the content-addressed store, hash-verified

733// Little helper function, to turn off the cache on requests which aren't cacheable to begin with.
734// This helps performance, a lot.
735static void
736CheckCacheable(TSHttpTxn txnp, TSMLoc url, TSMBuffer bufp)
737{
738 int pathsz = 0;
739 const char *path = TSUrlPathGet(bufp, url, &pathsz);
740
741 if (path && (pathsz >= 8) && (0 == memcmp(path, "nocache/", 8))) {
742 // It's not cacheable, so, turn off the cache. This avoids major serialization and performance issues.
743 VDEBUG("turning off the cache, uncacheable");
744 TSHttpTxnConfigIntSet(txnp, TS_CONFIG_HTTP_CACHE_HTTP, 0);
745 }
746}
747
748// Handle events that occur on the TSHttpTxn.
749static int

Callers 2

GeneratorTxnHookFunction · 0.85
TSRemapDoRemapFunction · 0.85

Calls 3

TSUrlPathGetFunction · 0.85
TSHttpTxnConfigIntSetFunction · 0.85
memcmpFunction · 0.50

Tested by

no test coverage detected