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 cQuery Cache Controlan 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
+
## Limitations
60
+
61
+
- Entity Framework Core:
62
+
-**DO NOT** support Cache Query Deferred (May be available when EF Core will be more stable)
63
+
64
+
## Requirements
65
+
66
+
-**EF+ Query Cache:** Full version or Standalone version
67
+
-**Database Provider:** All supported
68
+
-**Entity Framework Version:** EF Core
69
+
-**Minimum Framework Version:** .NET Framework 4
70
+
71
+
## Conclusion
72
+
73
+
As we have seen, EF+ Query Cache follows a good architecture principle:
74
+
75
+
-**Flexible:** Tag & Cache Options make it possible to use Query Cache in a various number of scenarios.
76
+
-**Extensible:** If there is something missing, the library creates your own extension method or your own cache to overcome the problem.
77
+
-**Maintainable:** The easy to use API, documentation and available source code allows new developers to quickly understand this feature.
78
+
-**Scalable:** Caching gets only better as the number of user/traffic grows by drastically reducing database round trip.
0 commit comments