Ok here is what I am wanting to do: Host an image on Photobucket, Use PHP to generate the image with a url as if it is being hosted on my site and cache the php generated image for faster loading later.
I am currently using a photobucket account to host my images so the original file I want to cache is actually at the following URL:
[code]http://i87.photobucket.com/albums/k126/WrestleMation/Brain_Rush_S01E01_DotNXT_DSR_XviD-E.gif
I am wanting to display the image with a URL from my site so that it doesn’t show the fact that it is on a photobucket account.
[code]http://wrestlemation.com/fa_Brain_Rush_S01E01_DotNXT_DSR_XviD-E.gif
As you can tell the image from the second link is being generated to pretty much pull in information from the first one and the displaying of the first one under the new URL works just fine.
To do what I’ve done, I used .htaccess rewriting to make the php image generation to use a standard image format url.
The php I used to generate the php image is…
[code]//Get dynamic filename from rewritten url. — which would be : Brain_Rush_S01E01_DotNXT_DSR_XviD-E
$gif_file = “http://i87.photobucket.com/albums/k126/WrestleMation/”.$_GET[‘file’].”.gif”;
//Load the image
header(“Content-Type: image/gif”);
echo readfile($gif_file);
die();
Ok so the image is generated just fine with my code but the problem is that it has to reload and redownload the image every time the browser is refreshed. Is there anyway I could force all browsers to cache the php generated image so when the generated url is called the next time it pulls from cache instead of pulling from the photobucket account?