Forward single request to upstream server via proxy_store !!

shahzaib shahzaib shahzaib.cb at gmail.com
Tue Sep 23 17:24:35 UTC 2014


But i cannot switch with proxy_cache because we're mirroring the mp4 files
for random seeking using mp4 module and proxy_cache doesn't support random
seeking. Is there a way i can use bash script with proxy_store ? I want the
following logic to prevent duplicate downloads :-

1st user :-

client (request the test.mp4) --> nginx (file not existed) --> check if
tmp.txt not existed --> create tmp.txt  --> download the test.mp4 from
origin --> remove tmp.txt

2nd user requesting the same test.mp4 :-

client (request test.mp4) --> nginx (file not existed)  --> tmp.txt already
existed (which means nginx already downloading the file) --> redirect user
towards the origin server(keep redirecting users as long as tmp.txt not
removed)

3rd user requesting the same test.mp4 :-

client (request test.mp4) --> nginx(file existed) --> serve from the cache.


SO tmp.txt plays the main role here and prevent the subsequent requests for
the same file but i have no idea how to implement it with nginx. Only if
someone point me towards right direction. :(

Regards.
Shahzaib

On Tue, Sep 23, 2014 at 9:41 PM, Valentin V. Bartenev <vbart at nginx.com>
wrote:

> On Tuesday 23 September 2014 19:34:23 shahzaib shahzaib wrote:
> > @Valentine, is proxy_cache_lock supported with proxy_store ?
>
> No.  But if you're asking, then you're using a wrong tool.
> The proxy_store feature is designed to be very simple and stupid.
>
> To meet your needs you should use the proxy_cache directive
> and its friends.
>
>   wbr, Valentin V. Bartenev
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140923/fea28c6b/attachment.html>


More information about the nginx mailing list