vod_expires
The `vod_expires` directive sets the expiration time for video on demand (VOD) content served by the NGINX VOD module.
Description
The vod_expires directive configures how long the cached response for video on demand (VOD) assets will be valid before clients are prompted to fetch a new version. This directive is useful in controlling caching behavior and ensuring that clients have the most up-to-date version of the media files. When set, it instructs NGINX to add an Expires header to responses for VOD requests, indicating the length of time the content should be considered fresh. This capability is essential for managing updates in dynamic or frequently modified media environments.
The parameter for this directive is a time duration that can be specified in various formats, including seconds, minutes, hours, and days. For example, a value of 1h would indicate that the media content should be cached for one hour. Properly using this directive allows system administrators to optimize bandwidth usage and reduce server load by leveraging browser caching where appropriate while also ensuring that users are eventually provided with updated content. However, care must be taken to choose an appropriate expiration time, balancing between caching effectiveness and the need for timely updates to the served media files.
Config Example
server {
listen 80;
location /vod/ {
vod_expires 1h;
}
}Setting too long of an expiration time may cause clients to receive stale content if updates are made to the media files.
Ensure clients support cache headers properly to utilize the benefits of this directive.