Link to home
Start Free TrialLog in
Avatar of PaulCutcliffe
PaulCutcliffeFlag for United Kingdom of Great Britain and Northern Ireland

asked on

I am 'webifying' an existing Notes application, but I'm finding my browser (IE7) keeps caching old copies of pages - how can I stop this from happening?

I have provided limited access to an existing Notes application for web users, but am finding that my browser, which is IE7, seems to cache the pages so that, for example, if you create a new Document, then click on a link to a View that displays that Document, it doesn't display unless you press F5. This is especially annoying as I've used frames, so pressing F5 actually goes back to the initial frameset. So instead you must right-click the frame in which the document is displayed, & click on the Refresh item in the pop-up menu.

I've just carried out a quick search on Google & EE and was a bit surprised to see so many pages explaining different methods to do this, along with comments that most of them don't work! Having said that, a fairly simple solution will work in this case, & if necessary, it could apply to all pages within the site - if the odd static page had to be reloaded each time, then that wouldn't be a major problem.

So has anyone got a solution for me?
Avatar of madheeswar
madheeswar
Flag of Singapore image

Keep below in HTML Head Content form event
"<META http-equiv=\"expires\" content=\"no-cache\">"
Avatar of PaulCutcliffe

ASKER

Excellent, thanks - that sounds exactly what I was looking for.

Someone else has suggested adding this:

@SetHTTPHeader("Cache-control";"no-cache")

Is that functionally equivalent?
ASKER CERTIFIED SOLUTION
Avatar of Bill-Hanson
Bill-Hanson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Bill-Hanson. Apparently (& according to http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb/7a36f0b1b817ffe285257370003cbf39?OpenDocument), madheeswar's advice is not quite right, as the no-cache content goes with the pragma meta tag, & the expires content requires a number.

Also there's the @SetHTTPHeader command too, which is better as proxy servers will read it, unlike any meta tags in the HTML.

So my final solution is this, in the HTMLHead field:

@SetHTTPHeader("Cache-control"; "no-cache");
"<META HTTP-EQUIV=\"expires\" CONTENT=\"0\">" +@NewLine +
"<META HTTP-EQUIV=\"pragma\" CONTENT=\"NO-CACHE\">"

Thanks for all your help.
Avatar of qwaletee
qwaletee

Make sure you also put that in your view template(s), or your views may get cached, not showing user's posts.
qwaletee, that was my intial issue that caused this whole thing - add a new document, then return to the view, only to see it was it was before!

I've added it to all the forms that will be used by the web users, including the ViewTemplate ones.

Thanks.
No, not me.
Sorry Bill-Hanson, I seem to have forgotten to Accept your solution & allocate the points - all done now.