views:

14

answers:

1

Hi,

I have two separate websites on the same server. One site is a forum (written in ASP Classic) where users may post information in various sections and threads etc. The other website (written in ASP.NET VB) is used for a club where users may purchase and download videos, etc. The Forum site uses caching to retain member information on each registered user. The club website has do do updates to a few of the user data fields stored on the Forum database. The problem is that I need to delete the cached information saved to cache for a specific user whenever I update the users information from the club website. Updates done on the Forum work just fine because it does delete the cache.

I have tried to access the cache from the ASP.NET club website using: Application.Contents("_mbUI-2") Which is the proper key but I get "Nothing". Since I can't access it, I can't delete it either. I guess the "Application" is separate due to the separate websites.

If I could call a page on the ASP site using xmlhttp, I could write a program to delete the cache. But, I need to call it from the code-behind, not by an event such as pressing a button and using javascript to make the http call.

If there were a way to access the cache from both websites, that would be ideal.

Any suggestions?

Thanks, James

+1  A: 

Use an active cache that detects changes directly in the database, like SqlCacheDependency. Or use a shared cache, like memcached. Or write an interprocess communication protocol between the two processes (the ASP.Net process and the classic ASP process). Implementing web service in the Classic ASP and calling the service from your ASP.Net could be a form of IPC good enough (inefficient, but simple).

If there were a way to access the cache from both websites, that would be ideal.

Using Memcached would give you just that. Memcached has both .Net client libraries and COM client libraries, so your ASP.Net and ASP Classic could both access the same Memcached farm (the 'farm' being in your case just one Memcached service running on the IIS server host). You would prefix all items with the application namespace to avoid colitions for separated items. The shared items you could either use a shared namespace (more elegant and efficient), but this would require the two clients to marshal the same (not trivial), or you could simple have each process invalidate the cache of the other one (less eficient and more ugly, but simpler).

Remus Rusanu
The SqlCacheDependency sounds interesting... If that will work with the ASP classic cache. I am not sure since the link talks about ASP.NET. I will look into this, thanks
Jim
The technology behind it (Query Notificaitons) *does* work with ASP Classic (see http://rusanu.com/2006/06/17/the-mysterious-notification/ and http://msdn.microsoft.com/en-us/library/ms130764(SQL.90).aspx) but in your case I believe memcached is more appropiate. Getting Query Notification to work with OleDB and classic ADO is far from trivial.
Remus Rusanu
I will look into the memcached, thank you!
Jim