Hi,
I have a read only root list that I use for lookups. The list contains images, so it's kinda large and noticeably slow pulling across the network. The list rarely changes.
Is there anything wrong with changing my class so it's like a NameValueList? That is, have an instance variable of the same type as the class, and in the public static Get method, populate it if it's null, otherwise just re-use it?
Seems to me that would be ok, but I've made lots of mistakes due to ignorance, so I thought I'd ask.
Thanks,
Mike
Brian and Rocky,
Thanks for verifying. I'll make an InvalidateCache() method that sets the instance variable to null in case it's ever needed. The list changes so infrequently (every couple months or so), I can probably get away with just re-launching the app.
Thanks,
Mike
I was skimming thru some new 2.0 features and recall reading that you can tie a cache to a data table, which means it would automatically invalidate when the table changes.
Sounds like what you might need!
Haven't tried it yet - so maybe it doesn't work or I mis-read that section. :) I'm a couple of weeks away from trying that in my own project...
Interesting, I don't recall reading that. Can you point me to a reference?
Thanks,
Mike
Professional ASP.NET 2.0, Evjen, et al. Publisher: WROX (Wiley Publishing)
p. 752:
"Because of the unsealing of the CacheDependency class, the ASP.NET team has built a new SQL Server cache dependency -- SqlCacheDependency. ... When a cache becomes invalid because a table changes within the underlying SQL Server, you now know it immediately."
p. 756 and following describe the SqlCacheDepency usage.
Keep us posted on how it works! (And any gotchas you run into.)
Thanks David,
I'll have to read up on that. I'm working on a Windows Forms project right now, so not sure if I could use it, but it sounds cool.
Mike
Copyright (c) Marimer LLC