When your client makes a manifest request to MediaTailor, the service evaluates all of the prefetch schedules that are associated with the playback configuration. If MediaTailor doesn't find a matching prefetch schedule, the service reverts to normal ad insertion and doesn't prefetch ads.
If MediaTailor finds a matching prefetch schedule, the service evaluates the schedule based on two components, retrieval and consumption.
- Retrieval
-
This defines the retrieval window, which is the time range when MediaTailor prefetches ads from the ADS. To set up the retrieval window, first determine when the ad break will occur.
For advanced use cases, you can optionally add dynamic variables to the prefetch request that MediaTailor sends to the ADS. This lets you send session, player, and other data to the ADS as part of the request. If you don't include dynamic variables in the prefetch schedule, MediaTailor uses the dynamic variables, if any, that you configured in your playback configuration's ADS URL.
- Consumption
-
This defines the consumption window, which is the time range when MediaTailor places prefetched ads into the ad break.
For this component, you can optionally add as many as five dynamic session variables for avail matching criteria to a prefetch schedule. MediaTailor uses these criteria to determine whether the ad break is eligible for placement of the prefetched ads. For example, you can use the scte.event_id dynamic variable if you want the service to place ads in an ad break with a specific SCTE event ID. MediaTailor places the prefetched ads into an ad break only if the ad break meets the criteria defined by the dynamic session variables.
For a list of supported avail-matching criteria, see the Available for ad prefetch column in the table on Using session variables.
When your client sends manifest requests to MediaTailor during the retrieval window, MediaTailor proactively sends requests to the ADS to retrieve and prepare the ads for later insertion. If you set up dynamic variables for retrieval, MediaTailor includes those variables in the requests.
When MediaTailor encounters an SCTE-35 ad break marker during the consumption window, the service uses the avail matching criteria, if configured, to determine which ad break to place the ads in. If avail matching criteria aren't configured, MediaTailor places the prefetched ads in the first ad break within the consumption window.
Understanding prefetching costs
For prefetch ad retrieval, you'll be charged at the standard transcoding rate for the
prefetched ads that MediaTailor transcodes. For prefetch ad consumption, you'll be charged at the
standard rate for ad insertion for the prefetched ads that MediaTailor places in ad breaks. For
information about transcoding and ad insertion costs, see AWS Elemental MediaTailor Pricing