uncleronin Posted March 14, 2007 Share Posted March 14, 2007 I'm using a bunch of graphs all over my site to display various statistics. Some pages have lots, some have one. The big issue is that if I display the graphs for a particular page multiple times in a row (changing the parameters each time) the graphs don't refresh. Instead the same graphs are shown each time! Is this because of caching or some php setting or some apache setting (using apache2 btw)? Is there any way to get around this or to force the graphs to refresh? Link to comment https://forums.phpfreaks.com/topic/42666-how-to-stop-jpgraph-gd-library-from-caching-or-to-force-a-refresh/ Share on other sites More sharing options...
chrisuk Posted March 14, 2007 Share Posted March 14, 2007 I have noticed the same issue. Perhaps use javascript to force a page refresh after it loads? Link to comment https://forums.phpfreaks.com/topic/42666-how-to-stop-jpgraph-gd-library-from-caching-or-to-force-a-refresh/#findComment-207055 Share on other sites More sharing options...
uncleronin Posted March 15, 2007 Author Share Posted March 15, 2007 Refreshing the page doesn't help. I've even gone so far as to prevent the actual page from caching but that doesn't do much either. Then again, images cache differently to pages. In IE the graphs refresh nicely but in FF the caching is handled differently so they dont refresh. I dunno, maybe FF has a cache setting somewhere but I have no idea how to force it to refresh pages. Maybe there's something in PHP which does this? Link to comment https://forums.phpfreaks.com/topic/42666-how-to-stop-jpgraph-gd-library-from-caching-or-to-force-a-refresh/#findComment-207922 Share on other sites More sharing options...
o3d Posted March 15, 2007 Share Posted March 15, 2007 Maybe try this in your script: <?php header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past ?> taken from www.php.net Link to comment https://forums.phpfreaks.com/topic/42666-how-to-stop-jpgraph-gd-library-from-caching-or-to-force-a-refresh/#findComment-207934 Share on other sites More sharing options...
uncleronin Posted March 16, 2007 Author Share Posted March 16, 2007 I've tried using no-cache but not with must-revalidate. Will see what happens. Link to comment https://forums.phpfreaks.com/topic/42666-how-to-stop-jpgraph-gd-library-from-caching-or-to-force-a-refresh/#findComment-208683 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.