Welcome! Log In Create A New Profile

Advanced

Re: nginx caching

July 19, 2009 07:32AM
On Sun, Jul 19, 2009 at 04:21:35AM -0700, Gabriel Ramuglia wrote:

> thanks, i didn't know that embedded perl could be used this way,
> that's a great help.

You may use

perl_set $backend_url 'sub { return "http://youtube_backend/url" }';

proxy_pass $backend_url;

Also, it better to add

upstream youtube_backend {
server ...;
server ...;
server ...;
}

to disable resolving on run-time.


> 2009/7/19 Igor Sysoev <is@rambler-co.ru>:
> > On Sun, Jul 19, 2009 at 02:54:34AM -0700, Gabriel Ramuglia wrote:
> >
> >> Hi,
> >>
> >> I've been using nginx for a while now to proxy flv videos via youtube,
> >> to good effect. However, the site that I'm accessing to proxy videos,
> >> I'm having problems being able to access their site in bulk, so I've
> >> decided to start caching things locally so as not to hit the remote
> >> server so often. I'm doing this in squid, and, for a variety of
> >> reasons, using the url_rewriter function to help out. My urls change
> >> every hour, but the video they refer to does not, so I have to use the
> >> rewriter to make sure the cache stays relevant.
> >>
> >> Now, the problem is, squid is using something like 60% of one core of
> >> cpu doing something like 200 megabit / s of bandwidth. This is on top
> >> of the fact that squid has to pass cache misses off to nginx, which is
> >> using another 20% or so (of one core, again) cpu use. Obviously if I
> >> could cut squid out of the equation this would be ideal.
> >>
> >> Is there a way in nginx to use the same functionality as the
> >> url_rewriter in squid? Is there a tutorial or other helpful links on
> >> doing caching in nginx?
> >
> > http://wiki.nginx.org/NginxHttpProxyModule#proxy_cache
> >
> > http {
> >
Subject Author Posted

nginx caching

Gabriel Ramuglia July 19, 2009 05:54AM

Re: nginx caching

Igor Sysoev July 19, 2009 06:56AM

Re: nginx caching

Gabriel Ramuglia July 19, 2009 07:21AM

Re: nginx caching

Igor Sysoev July 19, 2009 07:32AM

Re: nginx caching

john.wang507 February 19, 2011 01:36AM

Re: nginx caching

miikeh69 February 19, 2011 10:31AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 159
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready