Create Efficient Purge

This API is used to create a batch of efficient purge requests.It is path-based, it's possible to remove /foo/bar.txt, but not possible to remove everything under /foo/ for example.Content is physically removed relatively quickly, and the validity period for this is 2 weeks, i.e. if some node was offline for e.g. 5 days, the content will be still removed from it once it comes online.

1. Request Definition

  • API URL
https://cdn-api.swiftfederation.com/v2.0/services/{serviceId}/efficient_purge
  • Request Method
POST
  • Request Header

Refer to HTTP Request Headers

  • Request Body
Field Required Type Description
urls Mandatory string[] Array of urls for content removal.
  • Request Body Example
    {
      "urls": [
          "https://cdn.example1.com/resources/load.js",
          "https://cdn.example1.com/resources/load2.js",
          "https://cdn.example1.com/resources/load3.js"
      ]
    }
    

2. Response Definition

  • Response Header

Refer to HTTP Response Headers

  • Response Body
Field Type Description
batchId int the batchId of efficient purge
  • Response Body Example
{
    "batchId": 2
}

The API has limits that will lead to 429 HTTP response if they are hit. The response body in that case will contain a message saying which limit has been hit. Example:

Status: 429 Too Many Requests

{"code": "ratelimit", "message": "10 requests are allowed for one property per 00:01:00, 101 were already made"}
           Updated 2020-11-04 05:59:37

results matching ""

    No results matching ""