'Twas brillig, and Jean-Michel Philippon-Nadeau at 04/08/10 16:48 did
gyre and gimble:
> Hi List,
> My website uses a lot of external images coming from many different
> websites. Those images are sometimes small, sometimes big, and to
> reduce the loading time of my pages and for better uniformity, I've
> built a small PHP images server that resizes to a predefined set of
> dimensions the images if necessary. To save on CPU usage, the resized
> version is stored on Amazon AWS.
> When requesting an image of a specific size, if the resized image
> exists on AWS, that image is used. The images server then redirects
> the browser to the AWS URL.
> I don't believe having 80 redirections is a very clean solution so, my
> question is: How can I optimize my process while keeping the load on
> Amazon's servers?

Presumably you generate the links to the files to put into HTML or CSS
at some point?

Rather than check if an appropriate sized image is available then the
image is requested, why not check when you generate the link to the the
image? If when you generate the link it is NOT available, do the
necessary stuff to generate it and upload to AWS, then carry on.



Colin Guthrie

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to