jaymc Posted September 26, 2007 Share Posted September 26, 2007 I want to update a mysql field everytime an image is viewed Currently I use php to do the mysql stuff and also in the same file read in the image and set the headers to that I can display a dynamic image (image.php?id=2342) My server has been struggling when it has to load 10X dynamic images per page, so ive created static images which has helped server load Now when I display an image I do it the basic way <img src=imagename.jpg> However, my php/mysql can no longer be used !!!! Im just wondering, does it put any strain on the server simply using php to read in the file and then push it to the browser as an image using headers The way I see it, apache has to read that image off the disk anyway, so does it make much of a difference if PHP does it instead? If it will, I will notice it due to the number of images being displayed Thanks Quote Link to comment https://forums.phpfreaks.com/topic/70818-php-headers/ Share on other sites More sharing options...
corbin Posted September 27, 2007 Share Posted September 27, 2007 Man.... hold off on the caps please. I wouldn't think it would be a big deal to pull an image, write it to the browser, and then log the view.... Is the image being pulled from mysql or straight from the disk? Is it being pulled from a local drive? Quote Link to comment https://forums.phpfreaks.com/topic/70818-php-headers/#findComment-356060 Share on other sites More sharing options...
jaymc Posted September 27, 2007 Author Share Posted September 27, 2007 Basiaclly the script consists of // DO THE MYSQL STUFF // SET THE HEADERS // READ THE IMAGE TO BROWSER (images/username.jpg) Im not bothered about the MYSQL side of it, thats fine. Its just my previous system did the exact same as above except it would read the image from a static file and resize it, apply a water mark and borders then output it to the browser The processing resources combined together caused problems Now the image processing is done once, when they upload the file. Any time its called after that it just reffers to a static image Basically I just need to know if there is much difference from serving an image direct from apache as apposed to getting php to do it.. The way I see it, if php is reading the file then that means apaches back end isnt. So it should be practicaly the same amount of resources to serve a file providing im not manipulating the file using the GD image gizmos in php? Quote Link to comment https://forums.phpfreaks.com/topic/70818-php-headers/#findComment-356353 Share on other sites More sharing options...
jaymc Posted September 28, 2007 Author Share Posted September 28, 2007 Anyone have any information on this? Quote Link to comment https://forums.phpfreaks.com/topic/70818-php-headers/#findComment-357043 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.