BlueForge Docs

client.cdn.purge

Purge specific URLs from the CDN cache.

Signature

class Client {
  cdn: {
    purge(urls: string[]): Promise<{ success: boolean; purgedUrls: string[] }>
  }
}

Parameters

NameTypeRequiredNotes
urls
string[]
yesArray of CDN URLs to purge

Examples

import { Client } from '@blueforge/client'
const bf = new Client({ apiKey: process.env.BF_API_KEY!, url: 'https://your-project.blueforge.dev' })
const { purgedUrls } = await bf.cdn.purge(['https://cdn.example.com/img/1.jpg'])
console.log('Purged:', purgedUrls)

Throws

ErrorCondition
ApiError
API request failed
NetworkError
Network issue

Pitfalls

  • Propagation delay — purged URLs may serve stale content for up to 60s while the invalidation propagates through edge nodes
  • Rate limit — restricted to 20 requests per minute; subsequent requests are rejected with a rate-limit error
  • URL must be served by CDN — purging a URL that is not part of the CDN distribution is silently accepted but has no effect

See also

{auto-injected}

Tested against

{auto-injected}