Purge Content

Purging content invalidates the cached version of an asset from our edge servers. By default, the CDN will forward the next request for that content to the origin server.

View purging content tutorial.

Key information:

More information on purging (including syntax information).

Request

A request to purge content is described below.

HTTP Method Request URI

PUT

https://api.edgecast.com/v2/mcc/customers/AccountNumber/edge/purge

Define the following variable when submitting the above request.

VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3). Description

AccountNumber

Required

Replace this variable with a customer account number. This account number may be found in the upper right-hand corner of the MCC.

Request Headers

This endpointIdentifies a request's connection point to our REST API service. only takes advantage of common request headers.

Request Body

Pass the following request body parameters:

Name Data Type Description

EdgeNodeRegionIds

Array

Defines the set of regions to which the purge request will be applied. Set this parameter to the desired region ID(s). Use a comma to delimit multiple regions.

Regional purging is designed to meet specialized cache management needs. When in doubt, purge content from all regions.

Omitting this parameter will apply the purge request to the entire network (i.e., all regions).

Retrieve a list of platform-specific regions and their corresponding system-defined IDs through the Get Load/Purge Regions endpoint.

Although the response for the Get Load/Purge Regions endpoint includes the POPs (i.e., edge nodes) associated with each region and their system-defined IDs, the EdgeNodeRegionIds request parameter only accepts the system-defined IDs for load/purge regions.

MediaPath

Required

String

Identifies the CDN or edge CNAME URL corresponding to the asset or the location that will be purged from our edge servers. Include the protocol (e.g., http://) when specifying this URL.

More information on purging (including syntax information).

For the purpose of this endpoint, the http:// and https:// protocols are interchangeable.

MediaType

Required

Integer

Identifies a delivery platform from which an asset will be purged by its system-defined ID.

Valid values are:

  • 3: HTTP Large
  • 8: HTTP Small
  • 14: Application Delivery Network (ADN)

Response

The response to the above request includes an HTTP status code, response headers, and a response body.

Status Code

A status code indicates whether the request was successfully performed.

Response Headers

The response for this endpoint only includes standard HTTP response headers.

View common response headers.

Response Body

The response body for a successful request contains the following response parameter:

Name Data Type Description

Id

String

Reports a unique ID assigned to the purge request.

Pass this purge ID to the Get Purge Request endpoint to track the status of this purge request.

Errors

The response body for an unsuccessful request may contain an error parameter that provides additional information.

View common error messages.

Sample Request and Response (JSON)

A sample JSON request is provided below.

PUT https://api.edgecast.com/v2/mcc/customers/0001/edge/purge HTTP/1.1

Authorization: TOK:12345678-1234-1234-1234-1234567890ab

Accept: application/json

Content-Type: application/json

Host:api.edgecast.com

Content-Length: 92

{
	"MediaPath" : "http:\/\/wpc.0001.edgecastcdn.net\/000001\/WebPage.htm",
	"MediaType" : 3
}		

A sample JSON response is provided below.

HTTP/1.1 200 OK

Cache-Control: private

Content-Type: application/json; charset=utf-8

Date: Thu, 15 Apr 2021 12:00:00 GMT

Content-Length: 39

{
	"Id" : "522e0c33e5671c06c14224d7"
}

Sample Request and Response (XML)

A sample XML request is provided below.

PUT https://api.edgecast.com/v2/mcc/customers/0001/edge/purge HTTP/1.1

Authorization: TOK:12345678-1234-1234-1234-1234567890ab

Accept: application/xml

Content-Type: application/xml

Host:api.edgecast.com

Content-Length: 195

<MediaContentPurge xmlns="http://www.whitecdn.com/schemas/apiservices/">
	<MediaPath>http://wpc.0001.edgecastcdn.net/000001/WebPage.htm</MediaPath>
	<MediaType>3</MediaType>
</MediaContentPurge>		

A sample XML response is provided below.

HTTP/1.1 200 OK

Cache-Control: private

Content-Type: application/xml; charset=utf-8

Date: Thu, 15 Apr 2021 12:00:00 GMT

Content-Length: 161

<PurgeId xmlns="http://www.whitecdn.com/schemas/apiservices/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
	<Id>522e0c98e5671c06c14224d8</Id>
</PurgeId>