Woody Posted October 14, 2010 Report Share Posted October 14, 2010 Hello again folks. Is it possible to force a "refresh" when a visitor opens a page on my website which has been updated since their last visit? Every time I update a page, my son has to be told to refresh the page in order to see the changes. Thanks in advance! -Woody Quote Link to comment Share on other sites More sharing options...
newseed Posted October 15, 2010 Report Share Posted October 15, 2010 Typcially it's a broswer setting. Have him check the options and set it to refresh every visit. Quote Link to comment Share on other sites More sharing options...
Woody Posted October 15, 2010 Author Report Share Posted October 15, 2010 Thanks, newseed, but what about all the other visitors? Is there no way for MY website to initiate a "refresh"? Quote Link to comment Share on other sites More sharing options...
BeeDev Posted October 15, 2010 Report Share Posted October 15, 2010 You can set these headers, so a user's browser doesn't cache your pages: Cache-control: private Pragma: no-cache Expires: (a date in the past) But you need some kind of server-side code, ASP/PHP etc, also don't think it's a good practice for performance. But this is a beginners section, don't know if I should go in detail here. So I'll just leave it at that. Quote Link to comment Share on other sites More sharing options...
Webkiller Posted October 15, 2010 Report Share Posted October 15, 2010 (edited) Meta refresh redirects have been used by spammers to fool search engines. So search engines remove those sites from their database. If you use a lot of meta refresh tags to redirect pages, the search engines may decide your site is spam and delete it from their index. Below is just a refresh with no redirect. <meta http-equiv="refresh" content="600"> 600 the amount of time in seconds the browser should refresh page. Edited October 15, 2010 by Webkiller Quote Link to comment Share on other sites More sharing options...
BeeDev Posted October 15, 2010 Report Share Posted October 15, 2010 Oh my god, How can I forget <meta> tags lol. But Webkiller, OP is not looking for a way to refresh a page, he wants a way to refresh the cache in a user's browser. But thanks for reminding me about <meta> tag Disregard what I said above, you don't really need server side code, you can bung those above that I mentioned into a <meta> tag. This is a good place to read about those cache controlling meta tags: http://www.i18nguy.com/markup/metatags.html <meta HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> <META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT"> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.