post https://{app}.{filespin}.{io}/api/v1/cdn/prefetch
This API provides prefetch for assets so that you can pre-cache assets in CDN to speed up your websites and apps.
You can pre-cache:-
- video transcodes such as 480p-video.mp4, 720p-video.mp4, 1080p-video.mp4, etc.
- Example public transcode
<<CDN_HOST>>/api/v1/assets/ASSET_ID/transcodes/480p-video.mp4
- Example signed transcode
<<CDN_HOST>>/api/v1/assets/ASSET_ID/transcodes/480p-video.mp4?expiry=1452894790&accessId=IZJTAMBQGAYDAMBQGAYDAMBQGAYDANKT&signature=vsR0_NFfeLEJPc8MXWMh2xI2Qvg%3D
- Example public transcode
- image conversions like below
- Example public conversion
<<CDN_HOST>>/api/v1/assets/ASSET_ID/conversions?resize=200,200
- Example signed conversion
<<CDN_HOST>>/api/v1/assets/ASSET_ID/conversions?resize=200,200&expiry=1510659108&accessId=IZJTAMBQGAYDAMBQGAYDAMBQDBYDAMBR&signature=dwtRLuuL0PSmC-ZoIsh5zerMguc%3D
- Example public conversion
- other asset content obtained via
get_link
API such as- Example public asset
<<CDN_HOST>>/api/v1/files/content/ASSET_ID?key=original&expiry=1695802858&delivery=display&accessId=IZJTAMBQGAYDAMBQGAYDAMBQDBYDAMBR&signature=4FfPR8CyNFcEzf2jbGG5Ui6tBB0%3D
- Example public asset
Request JSON
{
"asset_urls": ["/video/8e563c1435e643b19fea2d42f2f73948/720p-wm-video.mp4"],
"cache_expiry": 12
}
Note:
- API payload can have upto 1000 asset URLs
- [DEPRECATED] Cache expiry can range from 12 hours to 30 days (720 hours)
- The
asset_urls
parameter should be valid video or image url parts - If the CDN Asset URL is not public, it must be a signed URL part
- see Signing Video URLs
- see Signing Image URLs
- see Asset Get Link API
CDN prefetch requests are throttled to prevent abuse. If you have more than a few assets to pre-cache, batch them in one API call.