I build my very own picture gallery for my website with jquery and php.

The image is very large, about 200 KB. my hosting is bandwidth metered, not limitless bandwidth. And than i attempt to optimize it with php every request that could indicat individuals image and remarkably php handle rid of it. it may optimize image about 75% become about 50 KB having a almost similar image in the original one.

what is your opinion is much better? i optimize the look every request with php or let apache handle image request however i need manualy optimize the look (with Illustrator) before i upload it to my webserver?

ps : i should also track every image request, use ajax and make my very own tracker for each request page including ajax request.

i'd process every image once when it is asked for for brand spanking new and store processed image to new file. the next time when file is asked for we ought to look if there is available its processed copy and allow the apache perform the relaxation of job.