Not in Varnish OSS

Native Cache Tags

Invalidate exactly what changed. Nothing more, nothing less.
AND/OR logic. Wildcards. Regex. 68x faster bulk purge.

Multi-Tag LogicWildcard PatternsBulk Operations

The Purge Problem

When a product changes, which cache entries need invalidating? The product page, category pages, search results, related products, homepage blocks... Without tags, you either purge too much (slow) or too little (stale content).

Varnish OSS: No Tags

  • • Purge by URL only
  • • Ban expressions degrade over time
  • • No tag-based invalidation
  • • Requires Varnish Plus ($$$)

Common Workarounds

  • • Purge entire cache (nuclear option)
  • • Short TTLs (defeats caching)
  • • Complex URL tracking (error-prone)
  • • Custom VCL hacks (maintenance nightmare)

Trident Cache Tags

One tag purge invalidates all related pages instantly

Tag Assignment (Automatic)

Your backend sends tags via X-Cache-Tags header. Trident stores them automatically.

# Backend response
HTTP/1.1 200 OK
X-Cache-Tags: product:123, category:electronics, brand:samsung
Content-Type: application/json

{"name": "Galaxy S24", "price": 999}

# Trident stores this entry with all 3 tags
# Any tag can trigger invalidation

Single Tag Purge

# Purge all entries with tag "product:123"
curl -X POST http://trident:8080/admin/purge/tag \
  -H "Content-Type: application/json" \
  -d '{"tag": "product:123", "mode": "soft"}'

# Response
{
  "status": "success",
  "entries_purged": 47,
  "duration_ms": 3
}

Multi-Tag AND Logic

Trident Exclusive

Purge entries that have ALL specified tags. Perfect for intersection queries.

# Purge products that are BOTH on sale AND in electronics
curl -X POST http://trident:8080/admin/purge/tags \
  -d '{
    "tags": ["sale", "category:electronics"],
    "mode": "and",
    "purge_mode": "soft"
  }'

# Only purges: /products/tv-sale, /products/laptop-deal
# Does NOT purge: /products/shoe-sale (not electronics)

Multi-Tag OR Logic

Trident Exclusive

Purge entries that have ANY of the specified tags. Great for batch updates.

# Price change affecting multiple products
curl -X POST http://trident:8080/admin/purge/tags \
  -d '{
    "tags": ["product:101", "product:102", "product:103"],
    "mode": "or",
    "purge_mode": "soft"
  }'

# Purges all entries tagged with ANY of these products
# Single API call, atomic operation

Wildcard Patterns

Trident Exclusive
# Purge ALL products (any product:* tag)
curl -X POST http://trident:8080/admin/purge/tag/pattern \
  -d '{"pattern": "product:*", "mode": "soft"}'

# Hierarchical purge
curl -X POST http://trident:8080/admin/purge/tag/pattern \
  -d '{"pattern": "category:electronics:*", "mode": "soft"}'

# Purges: category:electronics:phones, category:electronics:laptops, etc.

Regex Patterns

Trident Exclusive
# Purge all numeric product IDs
curl -X POST http://trident:8080/admin/purge/tag/pattern \
  -d '{"pattern": "product:\\d+", "type": "regex", "mode": "soft"}'

# Purge all sale items (tags ending with :sale)
curl -X POST http://trident:8080/admin/purge/tag/pattern \
  -d '{"pattern": ".*:sale$", "type": "regex", "mode": "soft"}'

Bulk URL Purge: 68x Faster

Need to purge 100 specific URLs? Trident does it in a single API call. Varnish requires 100 separate HTTP requests.

Trident

POST /admin/purge/urls
{
  "urls": [
    "/product/1",
    "/product/2",
    ...
    "/product/100"
  ],
  "mode": "soft"
}

Response: 20ms

Varnish

# 100 separate requests
PURGE /product/1
PURGE /product/2
...
PURGE /product/100

Total time: 1,372ms
20ms
Trident (100 URLs)
1,372ms
Varnish (100 URLs)
68.6x
Faster

E-commerce Example

Scenario: Product Price Change

Affected Pages

  • • Product detail page: /product/galaxy-s24
  • • Category pages: /category/phones, /category/samsung
  • • Search results: /search?q=galaxy
  • • Homepage featured block
  • • Related products on 20+ other pages

Without Tags

  • • Track all URLs manually
  • • 50+ individual purge requests
  • • Easy to miss pages
  • • Stale prices shown

With Trident Tags

POST /admin/purge/tag
{"tag": "product:galaxy-s24"}

# Done! All 50+ pages purged

Tag Statistics API

Monitor cache usage grouped by tag. Understand which content types consume the most memory.

GET /admin/tags/stats

{
  "total_tags": 15234,
  "total_entries": 89432,
  "top_tags": [
    {"tag": "product:*", "entries": 45231, "size_mb": 89, "percent": 36.3},
    {"tag": "category:*", "entries": 12892, "size_mb": 45, "percent": 18.4},
    {"tag": "cms:block:*", "entries": 8234, "size_mb": 23, "percent": 9.4},
    {"tag": "search:*", "entries": 5123, "size_mb": 18, "percent": 7.3}
  ],
  "orphan_entries": 234  // Entries without tags
}

Feature Comparison

FeatureVarnish OSSVarnish PlusTrident
Cache Tags
Multi-Tag AND/OR
Wildcard Purge
Regex Purge
Bulk URL Purge
Tag Statistics
Soft Purge

Smart Invalidation for E-commerce

Native cache tags are included in all Trident plans.