Skip to content

Cache operations

Two endpoints control what bots receive from cache. Both take a list of URLs. They differ in what happens to the version already cached:

RecacheInvalidate
Existing cacheStays live until the new render completesDropped immediately
Next bot requestServed the old version, then the new oneTriggers a fresh render and waits for it
Use it forRoutine content updatesA deleted page, corrected content, a changed status code

Prefer recache whenever the old version can keep serving until the new render is ready. Reach for invalidate when the cached version must stop being served now.

Both endpoints need the manager role or above. Failure cases are listed in errors and rate limits.

Recache URLs

POST /api/websites/{website}/cache/recache

Queue URLs for rendering. Existing cache entries are not affected until the render completes, so bots keep receiving the current version until the new one is ready.

bash
curl -X POST https://cloud.edgecomet.com/api/websites/123/cache/recache \
  -H "Authorization: Bearer eck_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://example.com/article/1",
      "https://example.com/article/2"
    ],
    "priority": "normal"
  }'

Request body

FieldTypeNotes
urlsstring[]Required. HTTP/HTTPS URLs. Up to 100 for priority=high, 1000 for priority=normal. Duplicates are silently removed.
prioritystringOptional. "high" or "normal". Default "normal". Use high for a just-published page that should re-render ahead of the queue.

Response (200)

json
{
  "entriesEnqueued": 4,
  "urlsAccepted": 2
}

urlsAccepted counts the URLs taken from the request. entriesEnqueued is the authoritative count of render jobs created - it can be greater than urlsAccepted when multiple cache dimensions apply to a URL (for example separate desktop and mobile cache entries).

Invalidate URLs

POST /api/websites/{website}/cache/invalidate

Drop cached entries for the given URLs. The next request from a bot triggers a fresh render.

bash
curl -X POST https://cloud.edgecomet.com/api/websites/123/cache/invalidate \
  -H "Authorization: Bearer eck_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"urls":["https://example.com/deleted-page"]}'

Request body

FieldTypeNotes
urlsstring[]Required. 1 to 1000 HTTP/HTTPS URLs.

Response (200)

json
{
  "entriesInvalidated": 2,
  "urlsAccepted": 1
}

urlsAccepted counts the URLs taken from the request. entriesInvalidated is the authoritative count of cache entries dropped - it can be greater than urlsAccepted when multiple cache dimensions apply to a URL.