Hi all
I've recently replaced the built-in caching mechanism of
Cuyahoga with the NHibernate second level cache. This works as expected except for one thing: when you set the relative expiration to 300 seconds, it appears that the caches times out after a period of 300 seconds of
no activity (because of sliding expiration of the ASP.NET cache?).
Especially with high-traffic web sites you want to set the cache expiration time a little higher to reduce database load but with a high traffic there is also a higher possibility that cached items never time out because it can happen that there is always any activity within the expiration period. This way, you can't tell when changes on the web site become visible for users. I must add to this that I'm using nonstrict-read-write caching for better performance. With read-write caching, any changes appear immediately.
So, is this relative (sliding) expiration by design and should I use read-write caching, or should cached objects always time-out after a fixed period of time?
Btw, in the mapping file you have to use <jcs-cache> tags to indicate that you want to use the second level cache. Hibernate 2.1.x uses <cache> tags for this, and I really think it would be good to line up with this syntax.
Thanks, Martijn