Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

VirtualPathProvider Cache Problem

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

837 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