shedokan Posted November 21, 2007 Share Posted November 21, 2007 Hello, I need my webpage to be the newest possible so people wouldn't see old pages, is that possible? thanks. Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/ Share on other sites More sharing options...
Distant_storm Posted November 21, 2007 Share Posted November 21, 2007 Do you mean instead of the browser using the cached page ?? If so you can do this using php's header function Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-395546 Share on other sites More sharing options...
teng84 Posted November 21, 2007 Share Posted November 21, 2007 Hello, I need my webpage to be the newest possible so people wouldn't see old pages, is that possible? thanks. question is not clear! Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-395548 Share on other sites More sharing options...
shedokan Posted November 21, 2007 Author Share Posted November 21, 2007 Do you mean instead of the browser using the cached page ?? If so you can do this using php's header function  yes, and how can I do that? Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-395551 Share on other sites More sharing options...
shedokan Posted November 21, 2007 Author Share Posted November 21, 2007 I found this script: header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-395579 Share on other sites More sharing options...
Distant_storm Posted November 21, 2007 Share Posted November 21, 2007 That would cause no cache to occure although this can be abit tough on your server if you get alot of hits in one go then it would have been easier for the browser to get the cache'd page. you can do the following  Set an expiry for your pages to be cache'd and then updated after that date. set when the page was last updated which is then checked against another value to see if the new page shoud be retreived from the server.   If you don't want your pages cached at all then   header ("Last-Modified: Wed,21 Nov 2006 01:41:00 GMT");  header ("Expires: Mon,26 Jul 1997 05:00:00 GMT");  header ("Pragma: no-cache");  header ("Cache-Control: no-cache"); Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-395585 Share on other sites More sharing options...
shedokan Posted November 21, 2007 Author Share Posted November 21, 2007 Do you have a script or an example I could see? to learn and use. Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-395586 Share on other sites More sharing options...
shedokan Posted November 21, 2007 Author Share Posted November 21, 2007 I want them to be chached but only if it's nessecary Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-395599 Share on other sites More sharing options...
phpQuestioner Posted November 21, 2007 Share Posted November 21, 2007 What exactly are you updating and how often do you update your site? I am trying to grasp what you are doing. Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-395600 Share on other sites More sharing options...
shedokan Posted November 21, 2007 Author Share Posted November 21, 2007 about each day or so, and I'm updating databases and pages. Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-395601 Share on other sites More sharing options...
phpQuestioner Posted November 21, 2007 Share Posted November 21, 2007 is it mostly text or images or a combination of both? Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-395604 Share on other sites More sharing options...
shedokan Posted November 21, 2007 Author Share Posted November 21, 2007 combination of both and database. Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-395605 Share on other sites More sharing options...
phpQuestioner Posted November 21, 2007 Share Posted November 21, 2007 I do not see how your pages are catching that much if your only updating your content once a day. You could create an JavaScript or AJAX script that would re-query your page at specific time. I would just create php no-cache header and you could try to create a javascript preloader for your images, but the no-cache header may not let them be preloaded. Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-395622 Share on other sites More sharing options...
shedokan Posted November 21, 2007 Author Share Posted November 21, 2007 But then I will have a lot of bandwidth used... Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-395823 Share on other sites More sharing options...
shedokan Posted November 22, 2007 Author Share Posted November 22, 2007 Please help!. Link to comment https://forums.phpfreaks.com/topic/78166-how-can-i-make-my-webpage-get-the-newest-page/#findComment-396833 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.