High Performance API (Deprecated)
In addition to our standard API, Ooyala also offers a high performance caching layer for API requests.
This caching layer may not be necessary for all applications, but it is ideal for the following cases:
- Your application generates a large number of API requests
- There a number of duplicate API requests such as each user generating the same query against a label
If these reflect your use case, we recommend using the high performance API.
High Performance API Usage
Here is what you need to know when using the high performance API:
- API requests need to be made to cdn-api.ooyala.com instead of api.ooyala.com.
While the high performance caching layer will keep a copy of your response for a few minutes, your expires parameter needs to be made "cache friendly." Unlike regular API requests where you'll often set the expires time to be just a few minutes from the current time, you'll find better performance setting it to a fixed time further out. For example, we can set it to always be the start of tomorrow with the following snippet:
today = Date.today expires = Time.mktime(today.year, today.month, today.day) + 86400
Alternatively, if you're generating urls to be used directly from a Flash / Flex application, you can simply pre-generate a url with an expires time years into the future.
High Performance doesn't mean it is better in all cases. Caching queries to the CDN is ideal for repeated, non-unique requests, but if you're generating unique requests (i.e. from search terms) each and every time, you'll want to query Ooyala directly.
Additionally, in scenarios where you always need the most up to date response, and can't wait a few minutes for a cached response to return, you should use api.ooyala.com