Faking Surrogate Cache-Keys for Nginx Plus
Sometimes you also need to use Nginx as caching layer. Purging the cache for a resource and its variants is often a very tedious task.
Surrogate Keys of other caching solutions are a better alternative but are not supported by Nginx yet. Alternatively, you can create something as powerful by combining the different dynamic dimensions of a resource to a cache key variable which then is appended to a custom cache key.
This way, the * -wildcard purging of Nginx can be used to purge all cache entries related to a certain resource with a couple of map directives.