Caching is good. What if, though, you could increase caching efficiency by letting some objects through the net, and not caching them as they are requested?
This is the thinking behind a new feature in the latest release of Varnish Enterprise that allows object misses to be counted via utils.backend_misses().
It’s part of the utils VMOD, and means that Varnish Enterprise can skip inserting an object into the cache the first time it’s requested within a certain time period, but insert it the second (or third, fourth,...) time it's requested within a given timeframe.
For example, if some piece of content is requested twice in one hour, the second time it’s requested it will be brought into the cache, ready for future requests.
The result? An increase in cache efficiency in environments where the content distribution has a very long tail. Storing long-tail content in cache when it’s never requested is an unnecessary use of resources, and this feature mitigates that, reducing cache churn.
Efficient caching of long-tail content
utils.backend_misses() is most useful for VOD streaming services, specifically those with vast catalogues of long-tail content. In these cases, it’s possibly not worth using caching resources for very deep cuts in a VOD archive if they are rarely requested by viewers. This feature means this content can be cached if it’s worth caching: when it starts being requested more than once. An object requested twice is more likely to be requested a third time.
You can read the documentation for utils.backend_misses() here for information on using the new feature.
For a complete changelog for Varnish Enterprise 6.0.7r3, go here.