Little helper function, to turn off the cache on requests which aren't cacheable to begin with. This helps performance, a lot.
| 733 | // Little helper function, to turn off the cache on requests which aren't cacheable to begin with. |
| 734 | // This helps performance, a lot. |
| 735 | static void |
| 736 | CheckCacheable(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. |
| 749 | static int |
no test coverage detected