Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Make a sub-folder 'expire immediately'?
sneel
#1 Posted : Wednesday, February 27, 2008 1:10:12 PM(UTC)
Groups: Member
Joined: 2/27/2008(UTC)
Posts: 3
Location: Chicago, IL

My web application generates images in a subfolder called 'graphs'. The image plots get updated while using the application. The problem I have is that the browser will cache the image. In IIS6, I simply mark the 'graphs' folder to expire content immediately, and it would work fine. How can I do a similar action in Cassini?

Thanks,

-Steve
Ultidev Team
#2 Posted : Wednesday, February 27, 2008 2:32:48 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Steve,

Since our Cassini does not let set caching policies at the folder level, we could recommend considering a couple of workarounds involving writing code:
- One is to either handle one of the Global.asax events, like Application_EndRequest to add cacheability control to no-cache in the response, or to use HttpModule plugged into the request pipeline through the web.config to set cacheabiliy properties there. Please note that if you run your application under both Cassini and IIS, HttpModule under Cassini will get its turn at every request, including ones for static files, like CSS, graphics and script files, while IIS in its default configuration only sends ASPX, ASMX ASHX other other .NET-specific requests to the HttpModule, and if your images are in JPEG format, then under IIS you HttpModule won't get its turn at handling requests for the files.

- Another way is to consider whether to generate your images on the fly and send them directly to the browser, instead of saving them to disk. This is not Cassini-specific trick - just ASP.NET. If your images are not reusable, and are made to be served just once after being generated, consider creating an HttpHandler - another .NET feature that lets you generate response of any MIME type, including image/jpeg. There cache control would be very easy.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
sneel
#3 Posted : Thursday, February 28, 2008 5:18:16 PM(UTC)
Groups: Member
Joined: 2/27/2008(UTC)
Posts: 3
Location: Chicago, IL

thanks for the quick response! The EndRequest event is going to work just fine.

Thanks,

-Steve
Rss Feed  Atom Feed
Users browsing this topic
Guest (3)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.