Create Prefetch

This API is used to create URL prefetches.

1. Request Definition

  • API URL
https://cdn-api.swiftfederation.com/v1.1/services/{serviceId}/prefetches
  • Request Method
POST
  • Request Header

Refer to HTTP Request Headers

  • Request Body

Request Body Data Format: JSON

Field Required Type Description
urls Mandatory string[] Array of urls which will be prefetched to edge server. Please note that number of maximum urls is 50. So please put urls no more than 50 for one prefetch batch request.
  • Request Body Example
{
    "urls": [
        "https://cdn.example1.com/resources/load.js?v=1.2.0",
        "https://cdn.example1.com/resources/load2.js?v=1.2.0",
        "https://cdn.example1.com/resources/load3.js?v=1.2.0"
    ]
}
  • Number of URLs Limitation

Every property has own limits which are checked each time when creating a new request.

By defaults limits as limitation:  
Number of urls made for the last minute - 10 urls  
Number of urls made for the past hour - 100 urls  
Number of urls made for the previous day - 1000 urls


2. Response Definition

  • Response Header

Refer to HTTP Response Headers

  • Response Body
Field Type Description
totalPages int Total pages of prefetch urls, page size is 50 request urls.
page int Current page of listing prefetch urls.
urls PrefetchURL[] List of prefetch url with id, serviceId, created time and status.
PrefetchURL Definition
id string UUID of prefetch URL request.
serviceId long Service id of prefetch url, it is domain or file download serivce id.
url string Full prefetch URL request.
created string Time of prefetch url request created in iso8601 format.
status string Shows the progress of prefetch. Could be "COMPLETE"/"FAILED"/"PENDING".
  • Response Body Example
{
    "totalPages": 2,
    "page": 1,
    "urls": [
        {
            "id": "uuid123",
            "serviceId": 10000,
            "url": "https://cdn.example1.com/resources/load.js?v=1.2.0",
            "created": "2018-01-31T10:30:57Z",
            "status": "COMPLETE"
        },
        {
            "id": "uuid124",
            "serviceId": 10000,
            "url": "https://cdn.example1.com/resources/load2.js?v=1.2.0",
            "created": "2018-01-31T10:30:58Z",
            "status": "COMPLETE"
        },
        {
            "id": "uuid125",
            "serviceId": 10000,
            "url": "https://cdn.example1.com/resources/load3.js?v=1.2.0",
            "created": "2018-01-31T10:30:59Z",
            "status": "COMPLETE"
        }
    ]
}
© 2019 Conversant Solutions Pte Ltd. All rights reserved.            Updated 2019-05-23 03:46:25

results matching ""

    No results matching ""