Welcome! Log In Create A New Profile

Advanced

nginx - cache VOD

Posted by patryk 
nginx - cache VOD
July 16, 2019 10:56AM
Hi,

I have a problem with configuring cache in nginx.
I need to cache the VOD stream from origin on disks for a long time. Once the material has been cached on the disk everything works fine, the player gets chunks from the disks. The problem arises when the material on the origin side has been swapped. Nginx does not know that the material has been modified and gives the player chunks from the disc instead of the origin.

How do I need to configure nginx to check when the VOD material was last modified and if it has current on the disk, it was given from disk and when on origin is newer it was given from origin and then cached?

my configuration:


#############################################################################################

proxy_cache_path /testy levels=1:2 keys_zone=my_cache:100m max_size=2100g inactive=4800h use_temp_path=off;

server {
listen 80;
server_name default;

location ~ / {
proxy_cache_key "$request_uri$http_last_modified";
proxy_pass http://127.0.0.1:6081;
add_header X-Cache-Status $upstream_cache_status;
proxy_cache my_cache;
proxy_cache_valid 200 206 4800h;
proxy_cache_revalidate on;
proxy_cache_background_update on;
proxy_cache_min_uses 1;
proxy_cache_use_stale updating error timeout http_500 http_502 http_503 http_504;
proxy_cache_lock on;
}}

#############################################################################################
Re: nginx - cache VOD
July 17, 2019 10:50AM
One more question.
Is it possible for nginx to check if Manifest / MPD is up to date and if it has not changed on the origin side, chunks were served from disk and if Manifest / MPD changed on the origin side, queries were directed to orign
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 102
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready