Purge static content on the fly
Cache tag headers are typically set at the origin, which means that you have no (or less) flexibility of your content. With tag purging, there are many interesting use cases for static objects. For example, you can control all images uploaded by user X and all images linked to product Y.
- https://www.scalemates.com/products/img/7/2/9/122978-10911-pristine.jpg
- https://www.scalemates.com/products/img/7/2/9/122978-10911-540.jpg
- https://www.scalemates.com/products/img/7/2/9/122978-10911-360.jpg
- https://www.scalemates.com/products/img/7/2/9/122978-10911-t280.jpg
- https://www.scalemates.com/products/img/7/2/9/122978-10911-t210.jpg
- https://www.scalemates.com/products/img/7/2/9/122978-10911-t140.jpg
Use the following steps to set up a cache tag for the above example. You’ll create a variable (PMUSER_CACHE_TAG) to store the cache tag, assign a name for the cache tag ( products-img-{{ID}}=products-img-122978), use the filename (built in variable) and a regex to extract the first digits. Each time the image changes on the website, all of the variants are purged.