Microsoft Knowledge Base Email Alertz

You receive a new Web page instead of a cached Web page even though the SetSlidingExpiration method is set to true on a computer that is running the .NET Framework 2.0

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 909643 - Last Review: December 3, 2007 - Revision: 1.3

You receive a new Web page instead of a cached Web page even though the SetSlidingExpiration method is set to true on a computer that is running the .NET Framework 2.0

SYMPTOMS

When you try to configure a Microsoft ASP.NET Web page to use a sliding expiration on a computer that is running the Microsoft .NET Framework 2.0, you receive a new Web page from the server instead of a cached Web page.

This issue occurs even though the SetSlidingExpiration method is set to true.

CAUSE

This problem occurs because a request to the origin server always generates a response when the SetSlidingExpiration method is set to true. A value of true sets cache expiration to sliding.

WORKAROUND

To work around this issue, use one of the following methods to prevent the origin server from generating a response when the SetSlidingExpiration method is set to true:
  • Response.Cache.SetLastModifiedFromFileDependencies
  • Response.Cache.SetETagFromFileDependencies
  • Response.Cache.AddValidationCallback

STATUS

This behavior is by design.

MORE INFORMATION

For more information about the Response.Cache.SetLastModifiedFromFileDependencies method, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/system.web.httpcachepolicy.setlastmodifiedfromfiledependencies(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/system.web.httpcachepolicy.setlastmodifiedfromfiledependencies(vs.71).aspx)
For more information about the Response.Cache.SetETagFromFileDependencies method, visit the following MSDN Web site:
http://msdn2.microsoft.com/en-us/library/system.web.httpcachepolicy.setetagfromfiledependencies(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/system.web.httpcachepolicy.setetagfromfiledependencies(vs.71).aspx)
For more information about the Response.Cache.AddValidationCallback method, visit the following MSDN Web site:
http://msdn2.microsoft.com/en-us/library/system.web.httpcachepolicy.addvalidationcallback(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/system.web.httpcachepolicy.addvalidationcallback(vs.71).aspx)

APPLIES TO
  • Microsoft .NET Framework 2.0
Keywords: 
kbtshoot kbcode kbprb KB909643
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate