Solved

VirtualPathProvider Cache Problem

Posted on 2008-06-22
3
1,383 Views
Last Modified: 2013-11-07
I implemented a VirtualPathProvider that delivers content from a DB.  Everything works fine except that the pages are cached indefinately.  Any changes to the content won't be reflected on the next call to the same page.  I have to in fact clear out the Asp.Net Temp folder in order to get the new content. How do I get VirtualPathProvider to always deliver up-to-date content.  I've even tried overriding the GetCacheDependency to always return Nothing and still no luck. I am using Vista as a development machine.
0
Comment
Question by:Webtologist
3 Comments
 
LVL 1

Accepted Solution

by:
jbeallva earned 500 total points
ID: 22000709
By trial and error, I've observed the following things must be true in order to get content fetched from a VirtualPathProvider to be "fresh".

1) GetCacheDependency must return null (Nothing in VB.NET)
2) GetFileHash must return a different value than the last hash for the file in question

This isn't a complete picture.  I don't totally understand how ASP.NET handles all the caching dependencies and why it requests file hashes for some files but not others (it seems to *never* request the hashes for your code files, only aspx and .master files, and I assume .ascx files as well).  Hopefully this will help some.  I'll post more information if I make further discoveries.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question