Posted by Jochem Maas on 10/06/40 11:12
Sebastian wrote:
> i have an issue with site linking directly to my images.
> the problem is these images are generated on the fly with php/gd -- they're
> generated each time its viewed because i have done some watermarking
> manipulation and didnt want to watermaker them in a static way. they're
> including the images like this:
>
> <img src=http://mydomain.com/script.php?pic=232">
>
> not only is bandwidth usage increase but so does cpu because php/gd has to
> process them as well.. if they're including 5 or 6 of these images on a
> single page i can imagin how much cpu is being used.
>
> how can i work around this, if at all possible?
you already got 2 answers covering the issues of direct linking to your images,
I would just like to add that you should also consider caching, you could
roll your own by saving the manipulated images on disk and checking to see whether
a cached image already exists before processing (and if it does just output that instead)
.... on the other end of the scale you could try Squid (which can also act as a reverse-proxy)
rgds,
Jochem
>
[Back to original message]
|