new image doesn't load in IE

Reply

Join Date: Jan 2007
Posts: 58
Reputation: crazynp is an unknown quantity at this point 
Solved Threads: 2
crazynp crazynp is offline Offline
Junior Poster in Training

new image doesn't load in IE

 
0
  #1
Apr 4th, 2007
Hi,

Will anybody please help me with this.

The bar chart image is created and stored using php code. each time the page is hit, the new image is created and displayed.

The firefox always dispaly the new image but IE always dispaly the old image and I have to refresh inorder to see the new one. may be this is due to cache.

Will anyone please guide me how to overcome this.

Thanks in advance!
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: new image doesn't load in IE

 
0
  #2
Apr 4th, 2007
Change the name of the file each time. That will prevent caching.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 58
Reputation: crazynp is an unknown quantity at this point 
Solved Threads: 2
crazynp crazynp is offline Offline
Junior Poster in Training

Re: new image doesn't load in IE

 
0
  #3
Apr 4th, 2007
Originally Posted by stymiee View Post
Change the name of the file each time. That will prevent caching.
Thanks stymiee !

but do you think this is an efficient solution? The number of files will get increasing and that need to be deleted.

Is it possible to disable the cahing?

Regards!
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: new image doesn't load in IE

 
0
  #4
Apr 4th, 2007
There's no reliable way to disable caching. You can send send out headers to prevent caching but I've found this to not be 100% effective. A better solution might be to use PHP to output the image. Then you can append a timestamp to the filename to make it look unique: <img src="/images/chart.php?1091343214">.

The php code in chart.php would look like this:

  1. <?php
  2. header('Content-type: image/gif');
  3. $fn = fopen("./chart.gif", "r");
  4. fpassthru($fn);
  5. ?>
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,084
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: new image doesn't load in IE

 
0
  #5
Apr 5th, 2007
Originally Posted by crazynp;
Thanks stymiee !

but do you think this is an efficient solution? The number of files will get increasing and that need to be deleted.

Is it possible to disable the cahing?

Regards!

Originally Posted by stymiee View Post
There's no reliable way to disable caching. You can send send out headers to prevent caching but I've found this to not be 100% effective. A better solution might be to use PHP to output the image. Then you can append a timestamp to the filename to make it look unique: <img src="/images/chart.php?1091343214">.

The php code in chart.php would look like this:

  1. <?php
  2. header('Content-type: image/gif');
  3. $fn = fopen("./chart.gif", "r");
  4. fpassthru($fn);
  5. ?>
If the PHP generated bar graph image is being saved as a file, then you can also use the method suggested by stymiee with the timestamp directly on the image...

eg:

<img src="/images/chart.jpg?1091343214" />

Even though its a jpg extension it should still bypass most HTTP caches (I have not tested this though). That way you don't have to pass the image data to PHP.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 58
Reputation: crazynp is an unknown quantity at this point 
Solved Threads: 2
crazynp crazynp is offline Offline
Junior Poster in Training

Re: new image doesn't load in IE

 
0
  #6
Apr 6th, 2007
Thanks to both of you. I will try to implement this after few days. Once again thank you both for help and suggestion.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2708 | Replies: 5
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC