Description
This plugin will let you decide at cache write time if you really want to allow the object to get into cache or not. Once in cache, it'll of course continue to be served out of cache. The typical use case here is for a small cache, where the tail-end content is huge. Instead of churning the disks, we only allow to write objects to cache if they are "popular" enough.
The first implementation only implements a very simple statistical policy, ChancePolicy() which takes a percentage argument. So, you give it a percentage, say 5%, which means there's a 5% chance that the response gets written to cache. 95% of the time the requests will go to origin instead.
Caveat: There's an unfortunate problem with the APIs I was hoping to use, so right now it can only make the decision to write to cache or not in the TS_HTTP_READ_RESPONSE_HDR_HOOK hook using TSHttpTxnServerRespNoStoreSet(txnp, 1);
Attachments
Issue Links
- is blocked by
-
TS-3426 Consolidate the multiple API for disabling cache
- Open