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

To pre-populate HTTP PULL and PUSH content to the CDN, use the following API call:

 

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

 

PLEASE NOTE: You can only prefetch content of HTTP CDN resources.

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

<prefetch_paths>/home/123.jpeg</prefetch_paths>

as well as without them:

<prefetch_paths>home/123.jpeg</prefetch_paths>

 

XML Request example

curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:cdn_resource_id/prefetch.xml -d '<prefetch_paths>/home/123.jpeg</prefetch_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/prefetch.json -d '{"prefetch_paths":"/home/123.jpeg"}' -H 'Accept:application/json' -H 'Content-type:application/json' 

Where:

prefetch_path *– path to the file you want to prefetch

 

To prefetch an array of paths:

XML Request example

curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:cdn_resource_id/prefetch.xml -d '<prefetch_paths type="array"><prefetch_path>/ui3/test1</prefetch_path><prefetch_path>/ui3/test2</prefetch_path><prefetch_path>/ui3/test3</prefetch_path><prefetch_path>/ui3/test4</prefetch_path></prefetch_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/prefetch.json -d '{"prefetch_paths":["/ui3/test1","/ui3/test2","/ui3/test3","/ui3/test4"]}' -H 'Accept:application/json' -H 'Content-type:application/json' 
#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels