Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Avoid Cached Pages 1

Status
Not open for further replies.

Binks810302

Technical User
Oct 9, 2003
10
ZA
Hi People,
How can I prevent the client from using cached pages. I want to achieve this without having to set the internet options>>General>>Settings to "Every visit to the page".
I have also tried settings the property on the IIS server to mark pages as expire immediately.
If there is some client side script that could be written or some other property that needs to be set, it would be appreciated.
Thanks
Binks
 
Hi,

Use GPO , if it is appropriate for your environment.
or
use IEAK to create a branding for deployment on client PCs.



Victor K
MCSE+I;MCSA;MCSE(w2k);CNE(5.1);CNE(6);CIWSP;CIWSA;Net+;CCNA
 
I have solved the problem.
If you have a cached page problem as described above,
first clear out all cached files.
Insert this bit of code in the beginning of
each of your asp pages. This code will prevent the client machine from caching the page.
<%
Response.Expires = 0
Response.ExpiresAbsolute = Now() - 1
Response.addHeader &quot;pragma&quot;,&quot;no-cache&quot;
Response.addHeader &quot;cache-control&quot;,&quot;private&quot;
Response.CacheControl = &quot;no-cache&quot;
%>
 
Whats 'GPO' GenEng?

Also is the purpose of the code supplied by Binks to prevent files stored in the 'Temporary Internet Files'
folder of the client machine or to prevent users paging back to a potentially expired page of asp generated results?

 
Skitty
If the user were to page back to a visited page, say by clicking on the back button, and the code I supplied is in beginning of that page, it will always pull a new version and not revert to the expired version. Given the latter I would think that it will not store the cached page. I am running the page of my local machine i.e. localhost so I am not that clear on storage of cached pages.
I hope this helps you Skitty.
 
Ahaa!

Yes you are right!
Great bit of code. I think in my minds eye I was expecting the sort of page you get from Amazon when you step back half way through a transaction sometimes. A page comes up saying it has expired or something.

However your code is real handy. many thanks and have a pink star.
 
GPO - is a Group Policy Object. You can control most IE operations through Group Policy.



Victor K
MCSE+I;MCSA;MCSE(w2k);CNE(5.1);CNE(6);CIWSP;CIWSA;Net+;CCNA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top