Varnish Tags

Component ID

1416782

Component name

Varnish Tags

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Varnish is one of the most efficient tools available to scale Drupal or any dynamic web application to the masses. Drupal.org uses it, Facebook uses it, I use it ;) There are a bunch of modules available that allow simple caching and cache clearing rules, but I have found none that use all of Varnish's more flexible aspects.

For example: It is possible to cache content per user, and keep almost everything in Varnish almost all the time - except when something changes. Maximizing cache hit rates may save on a lot of server hardware, and there are many ways. Some of the most extreme ways include content tagging with custom http-headers, and cache purges based on those headers.

For example, we could tag pages with an user's session_id, or we could tag the page based on all the nodes on it. Or node-types, or node terms, or entity_id:s or anything! The specifics on how it's done may not interest everyone, but the good part is that Drupal, it's hooks and available modules offer great tools that make this tagging possibly, and even easy. Create a rule to cache all pages fox user x. Or nodes tagged with "performance". Or combine both rules.

The purging part is also relatively easy, and both can be done in Drupal without any core hacking or other ugliness.

Efficient implementation will require some understanding of Varnish though. There is also a good possibility of breaking your site (temporarily, it's a cache after all).

This module is intended to integrate with other standard Drupal-modules such as rules, context and some more exotic, such as varnish, expire, context_http_headers and cache_actions. Will also try to play nice with other related modules such as cache_control and esi.