Solved

VirtualPathProvider Cache Problem

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 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

19 Experts available now in Live!

Get 1:1 Help Now