You could try inheriting from CacheAttribute and replace ICachePolicyConfigurer.Configure(HttpCachePolicy policy) where you would set the etag in the policy according to the request parameters.
Alternatively, if the url is really immutable (i.e. for the same url the resulting image is always the same) you can just cache it forever (duration = 10 years or so) On Sep 21, 3:17 pm, João Bragança <[email protected]> wrote: > I have a simple controller that loads an image off the disk, re sizes > it and outputs it to the response stream: > > [Cache(HttpCacheability.Public, ValidUntilExpires = true, Duration = > 60*60, VaryByHeaders = "x-castle-route")] > public void ViewLocal(string path, double? maxWidth, double? > maxHeight) > { > Context.Request.Headers.Add("x-castle-route", > Context.UrlInfo.UrlRaw); > byte[] data = File.ReadAllBytes(Context.Server.MapPath(path)); > OutputImage(data, maxHeight, maxWidth); // resizes with the bilinear > algorithm and outputs > > } > > Unfortunately I can no longer use made up headers in my environment > (rackspace cloud's medium trust rules). I don't use VaryByParams > because I use the routing engine. I think I can get this done with > ETags, but I can't find anything on the net about Castle/MonoRail and > etags. Can someone point me in the right direction? Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
