Clear CloudFlare cache

Purges cached Entria data. Use Authorize (HTTP Basic) with credentials from Worker secrets. Two modes, and they cannot be combined. Omit both parameters to purge every Cache-Tag, or set `tag` to purge one of them — these clear Cloudflare edge caches zone-wide and are not store-specific. Set `key` together with `storeHandle` to drop a single cached item for one store; `cart_…` ids are supported, and the response reports `purged: false` when nothing was cached for that key, which is not an error.

Authentication

AuthorizationBasic

HTTP Basic. Values come from Worker secrets CACHE_CLEAR_BASIC_USER and CACHE_CLEAR_BASIC_PASSWORD.

Query parameters

tagenumOptional
When set, only this tag is purged. Omit or leave empty to purge all of the above.
keystringOptional

Purge one individually-cached item instead of a tag. The entity is taken from the id prefix; cart_… is the only one supported. Requires storeHandle, and cannot be combined with tag.

storeHandlestringOptional

The store whose item is being purged. Required with key: a cart’s cache is addressed per store, and cart ids are unique only within one store’s Medusa.

Response

Cache cleared successfully
messagestring
purgedTagslist of strings
purgedKeystringOptional

Set when key was purged.

purgedbooleanOptional

Set when key was purged: false means nothing was cached for it, which is not an error.

Errors

401
Unauthorized Error
404
Not Found Error
500
Internal Server Error