I am trying to implement a caching control mechanism for my application which would allow me to expire the browser cache for .CSS, .JSS and .PNG files every morning at a specific time, or after a specified interval (say 8 hrs).
Default behaviour I'm seeing with static content:1. 200 OK - first time load
2. 304 OK - second time load, Expires header set to 24 hrs.
I've tried1. Putting IE7 cache control settings in web.config:
Code:<staticContent>
<clientCache cacheControlCustom="public;max-age" cacheControlMode="UseMaxAge" cacheControlMaxAge="0.00:01:00" />
</staticContent>
2. Creating a global.asax and setting headers on every request (yuch!)
Code:Response.Cache.SetCacheability(HttpCacheability.Private);
//Response.Cache.SetExpires(DateTime.Now.AddMinutes(1));
TimeSpan span = new TimeSpan(0, 0, 1, 0);
Response.Cache.SetMaxAge(span);
Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
Note: SetExpires didn't work at all. Set MaxAge worked the first time, then MaxAge was automatically set to 0 from then on..
I've considered, but not tried yet:1. Creating an HttpModule to try to implement this (similar to global.asax)
Can anyone tell me how to accomplish this under Cassini? It has always been very simple under apache or IIS..
thanks
Ken Jenson