Solved

VirtualPathProvider Cache Problem

Posted on 2008-06-22
3
1,353 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

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.…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

895 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now