Jump to content

images and bandwidth question


joecooper

Recommended Posts

Hi, im using the following code:

 

<?php

header("Content-type: image/png");

$im = imagecreatefrompng('www.externaldomain.com/image.png');

imagepng($im);

imagedestroy($im);

?>

 

this will return an image from another webhoster.

 

the image is about 500KB. so when a user requests that page, its going like:

 

externaldomain --> mywebserver --> user

 

Is this using up 1mb bandwidth for my webserver, as its getting the image from the externaldomain (500kb), and then sending to user (another 500kb) = 1mb?

Link to comment
https://forums.phpfreaks.com/topic/63891-images-and-bandwidth-question/
Share on other sites

I guess all I can do is vote on this as I don't "Know" either... but I agree... I think it probably would. After all... regardless of how the image is downloaded... it's still downloaded, even if it is only to compile the image before the user downloads your page. Having said that, whether your web host's tracking software is sophisticated enough to track this kind of behind the scenes activity is questionable and I'd be tempted to ask the question... Then again... it'd just alert them to a potential flaw if they didn't pick it up.

i think it does aswell as i think it works like it downloads the image from the other host, and then stores it while the user downloads it, and then it deletes it. ill have to check the logs later on. although its not like it takes ages to download the image, its more or less instant.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.