Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

force user's browser to check for updates?


  • Please log in to reply
2 replies to this topic

#1 RB_Kandy

RB_Kandy

  • Members
  • 141 posts
  • OFFLINE
  •  
  • Local time:08:24 AM

Posted 06 November 2012 - 01:54 AM

I got this problem with my website. If I were to change one of the pages' content right now, when I go back to the site, and go to that page, my browser will not notice the changes.
Example, if the background was blue, and I change it to red, and upload the .html file and I go back to that page with my browser, I will have to manually refresh the page to notice the changes, or the background will still be blue.

Is there any reasonable way to force a person's browser to refresh the page each time upon visit?

I did read somewhere some time ago about a refresh command (may have been php or html) and the web article warned that this could cause problems. So I was probably reading the wrong thing.

This needing to empty the cache or manually refresh a page isn't a big deal for most people. But some people never ever clear their browser's history, and therefore would never notice my updates.

I do a lot of movie reviews, and have to constantly update my table of contents, and I can just see some of my friends and relatives visiting that page for months, never seeing the new updates.

BC AdBot (Login to Remove)

 


#2 KamakaZ

KamakaZ

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:12:24 AM

Posted 06 November 2012 - 02:05 AM

You could try add the following into the <head> </head> section of your website

<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="expires" content="Wed, 19 Feb 2003 08:00:00 GMT"> <!-- Doesn't matter what this date is alsong as its in the past -->

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.


#3 Grinler

Grinler

    Lawrence Abrams


  • Admin
  • 43,614 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:09:24 AM

Posted 06 November 2012 - 10:37 AM

Yes, you will have to tell the browser to not cache the page.

What you should do is move your styling to a CSS file. Then load the CSS file like this:

<link rel="stylesheet" href="http://www.example.com/css/site.css?v=11.05.2012.00" type="text/css" />

The 11.05.2012.00 is a timestamp that you change everytime you modify your CSS file, which guarantees your changes are seen.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users