Child pages
  • Purge CDN Resource Content
Skip to end of metadata
Go to start of metadata

To remove content from HTTP Pull and PUSH cache, use the following request:

POST /cdn_resources/:id/purge.xml
POST /cdn_resources/:id/purge.json

 

PLEASE NOTE: You can only purge content of HTTP CDN resources.
 
<purge_paths>/home/123.jpeg</purge_paths>

 You can use purge CDN resouce content API requests with entry slashes:

as well as without them:

<purge_paths>home/123.jpeg</purge_paths>

 

XML Request example

curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:cdn_resource_id/purge.xml -d '<purge_paths>/home/123.jpeg</purge_paths>' -H 'Accept:application/xml' -H 'Content-type:application/xml' 

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:cdn_resource_id/purge.json -d '{"purge_paths":"/home/123.jpeg"}' -H 'Accept:application/json' -H 'Content-type:application/json'

Where:
purge_path – path to the content you want to remove


To purge an array of paths:

XML Request example

curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:id/purge.xml -d '<purge_paths type="array"><purge_path>/ui3/test1</purge_path><purge_path>/ui3/test2</purge_path><purge_path>/ui3/test3</purge_path><purge_path>/ui3/test4</purge_path></purge_paths>' -H 'Accept:application/xml' -H 'Content-type:application/xml'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:id/purge.json -d '{"purge_paths":["/ui3/test1", "/ui3/test2", "/ui3/test3", "/ui3/test4"]}' -H 'Accept:application/json' -H 'Content-type:application/json'

Where you have to specify an array of paths to the content you want to remove.

 

To purge all content:

 

XML Request example

curl -i -u  user:userpass -X POST http://onapp.test/cdn_resources/:cdn_resource_id/purge_all.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -u  user:userpass -X POST http://onapp.test/cdn_resources/:cdn_resource_id/purge_all.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where you have to specify a CDN resource ID.

 

If you are using version 3.0 or earlier, use the folowing request:

XML Request example

curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:id/purge.xml -d '<purge_paths>/ui3/test1\r\n/ui3/test2\r\n/ui3/test3\r\n/ui3/test4</purge_paths>' -H 'Accept:application/xml' -H 'Content-type:application/xml'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:id/purge.json -d '{"purge_paths":"/ui3/test1\r\n/ui3/test2\r\n/ui3/test3\r\n/ui3/test4"}' -H 'Accept:application/json' -H 'Content-type:application/json'

 

 

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels