Nginx – How to config NGINX for FLV streaming with proxy_cache

cachenginxPROXYstreamingvideo

I have a media storage server with over 20GB of free RAM. Server stores a FLV files. I'm using NGINX with HttpFlvStreamModule for streaming. It works like a harm.
I thought to take advantage of free memory for storing the most popular movies. This will give a breath for hard drives. I've try to use proxy_cache with directory mounted to RAM. Proxy cache worked fine, but flv module stoped working and I couldn't rewind the movie (seeking).
I've tried several nginx configurations but none of them work as I want.

Also I`ve try to use proxy_store but it's pretty poor in cache options.
The proxy_cache_min_uses option is very important for selection of the most popular files.

Anyone had a similar problem?

Best Answer

Unless I am misunderstanding your setup, you should not be using proxy_cache to speed things up, as nginx is on the same box as the media files. Just let the operating system use the extra RAM as filesystem cache (monitor and tune that behavior if necessary) - this will speed things up far more than proxy_cache would since everything is on the same box.

Nginx's proxy_cache (or Varnish, Squid, or any other HTTP cache) is only useful when the content you want to cache is on a different machine, or is being generated dynamically.