kvarnerexpress 0 Report post Posted June 10, 2005 I've developed a page that is composed of HTML and PHP and it pulls info from a DB to create a dynamic page. The one issue I'm seeing is that I'm having to hit refresh to get the page to pull information newly added to the DB. The browser seems to be pulling from cache. Is there a tag or script I can use to tell the browser to never pull this page from cache? Thanks.kvarnerexpress Share this post Link to post Share on other sites
SystemWisdom 0 Report post Posted June 10, 2005 Using PHP: if( !headers_sent() ){ header('Expires: ' . gmdate('D, d M Y H:i:s') . 'GMT'); header('Cache-control: no-cache');} Or using plain HTML:<META HTTP-EQUIV="Expires" CONTENT="Tue, 04 Dec 1993 21:29:02 GMT"> Of course, you may put any expiration date, the ones above are merely examples, though they would expire the content immediatley!I hope that helps! Share this post Link to post Share on other sites
Inspiron 0 Report post Posted June 11, 2005 Can this be done without PHP... maybe just Javascript ?It can be useful for me if it's done on Javascript... Share this post Link to post Share on other sites
Tyssen 0 Report post Posted June 11, 2005 The one issue I'm seeing is that I'm having to hit refresh to get the page to pull information newly added to the DB.So you're looking at a page, then you update the database and then you have to refresh your page to see the changes? Well I'm afraid that's the only way it's gonna work. How else is the page gonna update unless you refresh the browser?Unless you're talking about having to refresh more than once to see the changes. If you're talking about just one single refresh, then that's completely normal. Share this post Link to post Share on other sites
SystemWisdom 0 Report post Posted June 11, 2005 Can this be done without PHP... maybe just Javascript ? It can be useful for me if it's done on Javascript... 149905[/snapback] Or using plain HTML: <META HTTP-EQUIV="Expires" CONTENT="Tue, 04 Dec 1993 21:29:02 GMT"> Of course, you may put any expiration date, the ones above are merely examples, though they would expire the content immediatley! Yes, it can be done without PHP, just look at the example I posted using HTML.. Share this post Link to post Share on other sites
beeseven 0 Report post Posted June 18, 2005 The thing about doing it in Javascript is that not everyone has Javascript enabled. If it's really important to make your pages dynamic, you should do it with something that people can't turn off.That, and it may not even be possible to do it with Javascript. Share this post Link to post Share on other sites