Hi,
Asuming you are using the ASP.NET Cache i think it would be safer to iterate
through the Cache add delete all the entries.

Ricardo Lopes.

2009/2/27 jarrold <[email protected]>

>
> Thanks Felix and Ken for you advice. I think I've figured it out,
> please correct me if I'm wrong.
>
> Monorail just sets the response headers (expire or whatever you set
> using the Cache Attribute) then the server (IIS in my case) can be
> configured to cache it or not). I also found where the files are
> cached just in case anyone wants to clear it manually.
>
> C:\WINDOWS\Microsoft.NET\Framework\vx.x.xxxxx[depends on your ASP.NET
> version]\Temporary ASP.NET Files
>
> If I clear out the correct application files from this folder the
> request hits the controller again.
>
> Now my next question is there anyway to clear the cache from an action
> in a controller i.e. public void ClearCache() ?
>
> Thanks!
> Jarrold
>
> On Feb 26, 7:28 pm, Felix Gartsman <[email protected]> wrote:
> > Checkhttp://
> learn.iis.net/page.aspx/154/iis-7-output-caching/andhttp://blogs.iis.net/bills/archive/2007/05/02/iis7-output-caching-for.
> ..
> > Basically you set the normal caching headers and configure IIS. If IIS
> > decides it's cache-worthy it'll cache responses.
> >
> > jarrold wrote:
> > > Thanks for your reply Ken.
> >
> > > Now I see, so that means that this caching only improves performance
> > > for unique users. Is it possible to cache the generated html as a file
> > > so that IIS will just serve the file instead of hitting the controller
> > > again? So that even if 1000s of unique visitors hit the same url,
> > > it'll still just hit the controller at most once per the duration set
> > > (eg 10mins)?
> >
> > > Thanks in advance,
> > > Jarrold
> >
> > > On Feb 26, 2:51 pm, Ken Egozi <[email protected]> wrote:
> > > > 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/bloghttp://www.delver.comhttp://www.musicglue...
> >
> >
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to