Reloading a Page


I'm having trouble getting Coldfusion to relaod a page automatically without the user having to press the 'refresh' button.

I have an Intranet home page which pulls in all sorts of info from a database, which includes such things as a Bulletin Board, etc.  If someone adds something new to the Bulletin Board and then goes back to the home page, the new item does not appear without the person pressing 'refresh'.

Everyone within the company is using IE.  I realise I can get people to change their IE settings by going to Tools > Internet Options > General. And then selecting 'Every visit to the page' under 'Check for newer versions of stored pages', but I don't like this solution and would prefer it to be done for the user automatically.

Any ideas?

Thanks in advance.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

try to add this to your page:
so the page is not cached


add the following lines to your home page:
<cfheader name="expires" value="#now()#">
<cfheader name="Pragma" value="no-cache">
<cfheader name="Cache-Control" value="no-cache, no-store, must-revalidate">

the last one is the same as Mause's META-Tag.

Unfortunately some browsers/proxies still cahce pages instead of those settings. The only way to avoid that is to add an URL parameter to each link, that makes the page unique:
<a href="myPage.cfm?rnd=#getTickCount()#">Click here</a>

Don't forget to use <CFOUTPUT> around those links!




Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Procept I think its better to use the value 0 instead of #now()#  (now() Returns the date and time of SERVER) so:
<cfheader name="expires" value="0">

That will do the trick

IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.


I don't know whether 0 is better or now()....

But, I use those tags, plus (if that isn't enough) the getTickCount()-method, and, it works. :-))

I also think it will work...

but (if Im 'not wrong) the date in meta-expires is GMT and not the local time and if the value is 0 it will be interpreted as in the past .

but on the other hand now() generate something like this:
{ts '2003-11-06 10:54:11'}
and does not look this
Tue, 20 Aug 1996 14:25:27 GMT
so i guess it will not take now() as a valid value (just like 0)

nelliottAuthor Commented:

Thanks for your advice.  I've tried all of these, but I'm still not getting the page to refresh.

Looks as though the browser is still caching my query, as when I change the Settings in IE the page will refresh automatically.

Is there anything I can do in the Coldfusion Administrator to change the settings?

Thanks in advance
Did you open the page width these meta tags in it or was it still the old page!
make sure it is the page width these metatagss and then do something and go back to the homepage

nelliottAuthor Commented:

Lucky you were on the ball Mause, because I certainly wasn't!

Many Thnaks to you both for your advice.

Only fair to split the points I think!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.