Submits media refresh or prefetch tasks based on the media IDs.
Operation description
- ApsaraVideo VOD allows you to purge and prefetch resources. The purge feature forces the point of presence (POP) to clear cached resources and retrieve the latest resources from origin servers. The prefetch feature allows the POP to retrieve frequently accessed resources from origin servers during off-peak hours. This increases the cache hit ratio.
- You can call this operation to submit purge or prefetch tasks based on the media ID. You can also specify the format and resolution of the media streams to purge or prefetch based on your business requirements.
- You can submit a maximum of 20 purge or prefetch tasks at a time.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
MediaIds | string | Yes | The IDs of the media files that you want to refresh or prefetch. You can specify a maximum of 20 IDs. Separate multiple IDs with commas (,). You can use one of the following methods to obtain the ID:
| ca3a8f6e4957b658067095869****, a6e49sfgd23p5g9ja7095863**** |
TaskType | string | Yes | The type of the task that you want to create. Valid values:
| Preload |
Formats | string | No | The formats of the media streams you want to refresh or prefetch. You can specify multiple formats. Separate multiple formats with commas (,). If you leave this parameter empty, media streams in all formats are refreshed or prefetched by default. Valid values:
| mp4,m3u8 |
Definitions | string | No | Specifies the resolutions of the media streams you want to refresh or prefetch. You can specify multiple resolutions. Separate multiple resolutions with commas (,). If you leave this parameter empty, media streams in all resolutions are refreshed or prefetched by default. Note
The value must be supported in the Definition section in Parameters for media assets.
| HD, SD |
StreamType | string | No | Specifies the types of media streams you want to refresh or prefetch. You can specify multiple types. Separate multiple types with commas (,). If you leave this parameter empty, media streams in all types are refreshed or prefetched by default. Valid values:
| video |
ResultType | string | No | Specifies the type of the refresh or prefetch operation. Default value: Single. Valid values:
| Single |
SliceFlag | boolean | No | Specifies whether to refresh or prefetch the playback URLs of the TS files of the M3U8 media stream. Default value: false. Valid values:
| false |
SliceCount | integer | No | Specifies the number of the playback URLs of the TS files for the M3U8 media stream you want to refresh or prefetch. After you set this parameter, only the playback URLs of the first N TS files will be refreshed or prefetched. Valid values: 1 to 20. Default value: 5. | 5 |
UserData | string | No | The custom configurations such as callback configurations and upload acceleration configurations. The value must be a JSON string. For more information, see the "UserData: specifies the custom configurations for media upload" section in the Request parameter topic. Note
| {"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"}, "Extend":{"localId":"xxx","test":"www"}} |
Response parameters
Examples
Sample success responses
JSON
format
{
"MediaRefreshJobId": "41d465e31957****",
"NonExistMediaIds": "ca3a8f6e4957b658067095869****",
"ForbiddenMediaIds": "a6e49sfgd23p5g9ja7095863****",
"RequestId": "25818875-5F78-4AF6-04D5-D7393642****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2022-03-31 | Add Operation | View Change Details |