Microsoft KB Archive/909643

= 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 =

Article ID: 909643

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft .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

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

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

Keywords: kbtshoot kbprb kbcode KB909643

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.