views:

5

answers:

1

I have a web app that links to several thumbnail images from another server on the same domain that I have no configuration control over. The page loads about about 2 to 2.5 mb worth of static images. I would really like to have the server owner set the expires header so the images don't re-download every single time, but unfortunately that's not possible.

I was considering implementing a very simple proxy that simply passes the data through and injects the expires header. My server would take an extra hit for each initial connection as all the images would be proxied, but after the first client load, the client should just use the cached images and all that bandwidth/load times would be spared.

It SEEMS like a logical thing to do, but I can't find anything anywhere that recommends it or find an example where somebody else does this. Is this a good idea?

A: 

It will work, but it's terrible.

I would recommend to just grab everything from that remote server (at once or on as-requested basis), and copy it to your server/3rd party CDN. So that you will have 1 request per image, not 1 per image/user.

BarsMonster