nginx caching

Gabriel Ramuglia gabe at
Sun Jul 19 13:54:34 MSD 2009


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?


More information about the nginx mailing list