TrigRun
Use Cases

Scheduled Cache Warming and Invalidation

Automate cache refresh and invalidation on a cron schedule. Keep your CDN, Redis, or API cache fresh with TrigRun scheduled HTTP calls.

Keep your caches fresh by hitting your invalidation or warming endpoint on a schedule. No stale data, no manual purges, no cron server to maintain.

The problem

Your application caches expensive queries, CDN content, or API responses. Caches go stale, but you don't want every user request to trigger a cache rebuild. You need a scheduled refresh — and if it fails, you need to know immediately.

The TrigRun solution

SettingValue
Schedule*/15 * * * * (every 15 minutes)
MethodPOST
Timeout60 seconds
Retries2 attempts

Create via API

curl -X POST https://api.trigrun.com/v1/jobs \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Cache warming - product catalog",
    "kind": "cron",
    "schedule": {
      "cron": "*/15 * * * *"
    },
    "request": {
      "url": "https://api.yourapp.com/cache/warm",
      "method": "POST",
      "headers": {
        "Authorization": "secret://internal-api-key"
      },
      "body": {
        "collections": ["products", "categories", "pricing"]
      },
      "timeout_seconds": 60
    },
    "retry_policy": {
      "max_attempts": 2,
      "retry_on_statuses": [500, 502, 503]
    }
  }'

Common patterns

CDN cache purge

{
  "name": "CDN cache purge - assets",
  "kind": "cron",
  "schedule": { "cron": "0 */4 * * *" },
  "request": {
    "url": "https://api.cloudflare.com/client/v4/zones/ZONE_ID/purge_cache",
    "method": "POST",
    "headers": {
      "Authorization": "secret://cloudflare-api-token",
      "Content-Type": "application/json"
    },
    "body": { "purge_everything": true }
  }
}

Redis cache refresh

{
  "name": "Redis cache rebuild - leaderboard",
  "kind": "cron",
  "schedule": { "cron": "*/5 * * * *" },
  "request": {
    "url": "https://api.yourapp.com/admin/cache/rebuild-leaderboard",
    "method": "POST",
    "headers": { "Authorization": "secret://admin-key" }
  }
}

Common schedules

PatternExpressionUse case
Every 5 minutes*/5 * * * *Real-time leaderboards, pricing
Every 15 minutes*/15 * * * *Product catalogs, search indexes
Every hour0 * * * *Dashboard data, analytics
Every 4 hours0 */4 * * *CDN purge, full rebuild

On this page