These are two different caches. HttpRuntime.Cache is the server side cache - that caches data on the server.
the CacheAttribute has to do with CACHE headers of the HttpResponse being sent to the browser - resulting with browsers and proxies caching the responses (or not) On Thu, Feb 26, 2009 at 5:12 AM, jarrold <[email protected]> wrote: > > Hi guys, > > I'm new here, was previously using the old Castle Forum... didn't know > this group existed. lol. > > Anyways, I'm using the Cache Attribute to set up some caching for some > actions in a controller like this: > > [Cache(HttpCacheability.Public, Duration = 86400, VaryByParams = > "CategoryId" )] > public void ProductPropertyValues() { ... } > > The caching works as advertised but I want to create an action to > clear the cache manually using something like this: > > public void ClearCache() > { > IDictionaryEnumerator CacheEnum = HttpRuntime.Cache.GetEnumerator > (); > > while (CacheEnum.MoveNext()) > { > HttpRuntime.Cache.Remove(CacheEnum.Key.ToString()); > } > > RenderText("Cache Cleared!"); > } > } > > Right now this doesn't work as the cache only contains my Nvelocity > templates. Which cache is being used? > > Also I'm from RoR background, and I know in RoR you can set up an > observer to expire the cache when models change. Is there anyway to > accomplish this in Monorail? > > Looking forward to your expert advice, > Jarrold > > > > -- Ken Egozi. http://www.kenegozi.com/blog http://www.delver.com http://www.musicglue.com http://www.castleproject.org http://www.gotfriends.co.il --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---
