Lightweight scalable image proxy

I need to proxy images from facebook through a different url (one which
I can put a crossdomain.xml file)

Im currently using like 20 mongrels where I run:

def index
return unless params[:url].include?(“facebook.com”)
headers[‘Content-Type’] = ‘image/jpeg’
headers[‘Cache-Control’] = ‘public’
headers[‘Expires’] = ‘Mon, 28 Jul 2020 23:30:00 GMT’
open(params[:url]).read
end

However, this will not scale. Since if hundred people are requesting
images at the same time, many will get dropped. Im thinking that I could
do something with apache mod_proxy but I dont know anything about it.

Im sure for a seasoned deployment guru, this probably like 4 lines of
code in some apache config file.

Any ideas?

Thanks in advance.

nginx

Setup should be fairly simply, and performance will rock.

On Jan 3, 1:00 pm, Aryk G. [email protected]

On Jan 3, 1:00 pm, Aryk G. [email protected]
wrote:

However, this will not scale. Since if hundred people are requesting
images at the same time, many will get dropped. Im thinking that I could
do something with apache mod_proxy but I dont know anything about it.

Oh, sorry Aryk, I didn’t see that you mentioned Apache.

mod_proxy should work quite well.

You may need to reverse proxy these requests as well, not actually
sure when that’s required.

Aryk G. escribió:

open(params[:url]).read

Any ideas?

Thanks in advance.

Hi Aryk, this link about modproxy[1] (see maximum connections and soft
maximum connections), I guess it help you.

[1]mod_proxy - Apache HTTP Server Version 2.2


Rafael Garcia Ortega