Setting expiration on cached entities with SharedCache and Nhibernate

235 Views Asked by At

I have an MVC webapp that I'm putting together now. A second app publishes data to a database which my webapp reads from.

I am using SharedCache as a cache provider for my NHibernate and I wish to assign "expirations" to my entities (so I can guarentee a level of freshness of the data) - and knowing that some entities are rarely updated and others regularly, it would be ideal to have different cache regions with different expirations.

I've seen numerous examples on the web of how to do this with SysCache but can't find any for SharedCache.

Thanks in advance.

1

There are 1 best solutions below

1
On BEST ANSWER

So I went to the source code for the SharedCache NHibernate Provider and found out for sure that there couldnt be an expiration set on entities.

I am going to add this functionality myself - it is very straight forward to do so.