My server: Shared VPS Centos 4 Equal share CPU 1GB Burst RAM 256MB RAM
My question: I have a .php file generate thumbnails on the fly. I have a moderate amount of traffic. Sometimes the gallery(s) shown can list up to 20 or so images, with fairly large thumbnails. Am I causing uneccessary server load by not just making my own thumbnails and having all these galleries generated on the fly?
You mentioned gallery ... if you are using an image upload process for your gallery you could generate the thumbnails during the image upload process once at that point rather than generate them on every page view.
The way the thumbnails are generated is fine ... But you should save the generated thumbnail. Then, for each request ... first see if the image exists. If it does, send that. If not, create a resized and send that.