Jump to content

PHP HEADERS


jaymc

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.