You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Caching read-only data like application configuration.
45
+
- Caching data that can only be modified via an importation like states & countries and make all cache entries related expired once the importation is completed (Tag Expiration).
46
+
- Caching data that are frequently accessed but rarely modified like comments and expire the tag when a new comment is added or after one hour without any access (Tag Expiration & Sliding Expiration).
47
+
- Caching statistics that don't require to be live like client count and expire them every hour (Absolute Expiration).
48
+
49
+
## Behind the code
50
+
51
+
When **FromCache** is invoked, The QueryCacheManager returns the result if a cache entry exists for the cache key. If no cache entry exists, the query is materialized then cached in the memory using the cache key before being returned. If a cache tag is specified, the cache key is also stored in a concurrent dictionary for all tags.
52
+
53
+
-**The Cache:** The memory cache is used by default.
54
+
55
+
-**The Cache Key:** The cache key is created by combining a cache prefix, all cache tags and the query expression.
56
+
57
+
-**The Query Materialized:** The query is materialized by either using "ToList()" method or "Execute()" method for query deferred.
58
+
59
+
## Requirements
60
+
61
+
-**EF+ Query Cache:** Full version or Standalone version
62
+
-**Database Provider:** All supported
63
+
-**Entity Framework Version:** EF5, EF6
64
+
-**Minimum Framework Version:** .NET Framework 4
65
+
66
+
## Conclusion
67
+
68
+
As we have seen, EF+ Query Cache follows a good architecture principle:
69
+
70
+
-**Flexible:** Tag & Cache Options make it possible to use Query Cache in a various number of scenarios.
71
+
-**Extensible:** If there is something missing, the library creates your own extension method or your own cache to overcome the problem.
72
+
-**Maintainable:** The easy to use API, documentation and available source code allows new developers to quickly understand this feature.
73
+
-**Scalable:** Caching gets only better as the number of user/traffic grows by drastically reducing database round trip.
0 commit comments