Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VirtualPathProvider Cache Problem

Posted on 2008-06-22
3
Medium Priority
?
1,475 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
1 Comment
 
LVL 1

Accepted Solution

by:
jbeallva earned 2000 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 to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

783 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