Support for Second Level Cache
Entity Framework currently support only first level cache (cache for entities). I would like to see a second level cahce implemented in the next version (queries cache).
12 comments
-
Simon de Kraa
commented
Especially on Windows Azure where at the moment you have quite a performance penalty using SQL Azure and with the availability of Windows Azure cache to me this seems like a must have on Windows Azure.
-
useroger33
commented
Also a sample with dbcontext http://www.codeproject.com/Articles/435142/Entity-Framework-Second-Level-Caching-with-DbConte
-
Vahid Nasiri
commented
Here you can find an implementation of second level caching in EF Code first:
http://www.dotnettips.info/File/UserFile?name=EfSecondLevelCaching.zip -
Alexandre
commented
This is already something that can be acheived http://msdn.microsoft.com/en-us/magazine/hh394143.aspx but it should be something simple to accomplish.
-
bchoi
commented
@Tommy compare EFCachingProvider to NHibernate's built in configurable option. 2nd level cache is a must for ORM and should be readily available to the user.
-
Tommy
commented
Unless I don't understand this issue correctly, this would be achieved by simply expanding upon Jaroslaw Kowalski's example of implementing first level caching:
http://blogs.msdn.com/b/jkowalski/archive/2009/06/11/tracing-and-caching-in-entity-framework-available-on-msdn-code-gallery.aspxHis example already provides access to the underlying connections and commands, which you should have no problem using to extend as described?
-
Byung Choi
commented
EF should be easily extensible. One of the main concern is caching.
Hibernate and NHibernate went through this issue years ago. -
Felipe Fujiy Pessoto
commented
Cache isn´t responsability of domain.
Cache is a cross-cutting concern. -
henrik
commented
ASP really need cashing support.
-
Bassam
commented
if that means the ability to query the datacontext offline without db connection using LINQ , then that would be really cool and much much needed
-
Denis Kotov
commented
Caching is needed for ASP.NET applications. Possibility addition dependence on changes in a source by SqlCacheDependency.
-
Unai Zorrilla
commented
Nooooooooooooooo, cache is responsability of domain, cache is bussines no data .......