| | |
new image doesn't load in IE
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2007
Posts: 58
Reputation:
Solved Threads: 2
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!
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!
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!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
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:
The php code in chart.php would look like this:
<img src="/images/chart.php?1091343214">.The php code in chart.php would look like this:
php Syntax (Toggle Plain Text)
<?php header('Content-type: image/gif'); $fn = fopen("./chart.gif", "r"); fpassthru($fn); ?>
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
•
•
•
•
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!
•
•
•
•
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:
php Syntax (Toggle Plain Text)
<?php header('Content-type: image/gif'); $fn = fopen("./chart.gif", "r"); fpassthru($fn); ?>
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!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Similar Threads
- accessing images in mobile phones (C++)
- arrays & images (HTML and CSS)
- Help with CAPTCHA (PHP)
- How would I make a tile map, that is easily alterable? (Python)
- When setting up raid 1 do can you use sata drives? (Storage)
- Sharing an IMAGE amongst objects to save memory [C#] (C#)
- brokenconnection.com reveiws needed (Website Reviews)
- timer countdown help (Visual Basic 4 / 5 / 6)
- stuck in cgi image stuff (Python)
Other Threads in the PHP Forum
- Previous Thread: PHP gaming site
- Next Thread: Sending HTML email via PHP mail function
Views: 2708 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access address ajax apache api array autoincrement beginner binary broken cakephp checkbox class cms code cron curl database date dehasher directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu method methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure support! syntax system table tutorial update updates upload url validation validator variable video web xml youtube






