Entity Framework second level cache

.net asp.net-mvc caching entity-framework entity-framework-6

Question

I want to use EntityFramework.Cache for one of my tables, but I can not find any information about how does it work with live data and relationships?

I want to know if I add some data to my table or the relation tables does it understand it and re-cache table again or the result could be stale?

Does anyone work with any Entity Framework second level cache?

1
1
2/22/2016 8:41:00 AM

Accepted Answer

A cache normally caches entities (Detached from the context) and re-uses the same result as long as the cache is not expired.

If you change the query, a new result is cached (even if it returns the same entity key) since relations could have been changed.

Here is an alternative to the cache you are currently using:

Disclaimer: I'm the owner of the project EntityFramework Plus on GitHub

EF+ Query Cache allows to cache query with tag, expiration and cache control.

Documentation: Entity Framework - Second Level Cache

3
8/26/2018 7:38:02 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow