Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

nginx - cache VOD

$
0
0
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;
}}

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

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>