Resize & cache image from 3rd-party server?

Igor Sysoev is at
Tue Sep 22 08:26:29 MSD 2009

On Mon, Sep 21, 2009 at 06:06:09PM -0400, digitala wrote:

> Is it possible to obtain an image from a remote http server, resize it locally, and cache it locally using just nginx? I understand this would be possible using the perl module (maybe forking perl so nginx doesn't block), but I'm assuming it would be faster for nginx to do it "natively".
> If the better route *is* perl, I'd still like to know if/how it could be done using just nginx - mainly as it will help my (and hopefully others) understanding of the nginx internals.

Currently nginx can get an image from a remote server, cache the original
image locally, then resize it. nginx can not cache the resized image at
the moment. However, you may set second nginx to cache it:

client -> nginx/cache -> nginx/resize/cache -> remote server

Igor Sysoev

More information about the nginx mailing list