|
This feature is not available in NCache Express and Professional edition.
|
EFCaching configuration file contains information regarding Entity Framework provider. It is installed with NCache and is located at "%Install Directory%/NCache/config". efcaching.ncconf is used for enabling NCache in Entity Framework applications. The configurations are stored in an efcaching.ncconf file.
EFCaching configuration file is explained below:
-
Mode: Can either be "analysis" or "caching". (Hot Applicable)
-
Default = 'caching'
-
"Analysis" mode is used for monitoring the number of times each query executes and then it generates a report. Report contains the Query text and the call count for each query. This report can be used in Custom policy. No caching is done at this mode.
<analysis-policy log-path = "" analysis-time = "60" cache-enable-threshold = "5" default-expiration-type = "absolute|sliding" default-expiration-time = "180" dbsyncdependency = "true"/>
Default = < install-dir > /log-files/efcaching-analysis-logs/
-
dbsyncdependency: Determine whether to enable database-dependency or not.
-
Default = "true"
-
For "Caching" mode, wrapping provider will cache the results of all the specified queries. Caching mode works on either cacheall policy or custom policy. Both policies have their own specifications. Whenever update is detected (either UPDATE, INSERT or DELETE) in a respective database, the provider invalidates affected cache entries by evicting all cached queries which were dependent on any of the updated tables.
<cache-policy default-policy = "cacheall|custom" database = "none|oracle10i2|sqlserver" cache-id = "mycache" enabled = "true">
-
Default-policy: The default policy for caching. (Hot Applicable)
-
Default = 'cacheall'
-
Database: Database information is collected to create database sync dependency. (Hot Applicable)
-
Default = 'none'
-
Cache-id:
-
Default = 'mycache'
-
Enabled: Determine whether the policy is in effect or not. (Hot Applicable)
-
Default = 'true'
-
For cacheall policy, it caches all the queries and their results.
<cacheall-policy expiration-type = "absolute|sliding" expiration-time = "1800" dbsyncdependency = "true"/>
-
Expiration-type: Type of expiration, it can be 'sliding' or 'absolute'.
-
Default = 'absolute'.
-
Expiration-time: Default = 180 sec (3 min)
dbsyncdependency: Determine whether to enable the database-dependency or not.
-
Default = 'true'
-
For custom policy, it includes user-configurable list of queries that should be cached with their results. When custom policy is selected, only those queries results will be cached for which the caching is enabled. You can also specify custom caching policy for all queries.
<custom-policy>
<query query-text = "" ["SELECT FROM Products"] | stored-procedure-name = "" ] caching = "true" expiration-type = "absolute"| sliding = "" expiration-time = "180" dbsyncdependency = "true"/>
</custom-policy>
</cache-policy>
</app-config>
</configuration>
-
Expiration-type: Type of expiration, it can be 'absolute' or 'sliding'.
-
Default = 'absolute'.
-
Expiration-time: Default = 180 sec (3 min)
-
dbsyncdependency: Determine whether to enable database-dependency for analyzed queries.
-
Default = " true"
-
In case of stored procedures, query text will be the name of a stored procedure, and there will be no default policy or database sync dependency. User can cache stored procedures result with expiration only, no database dependency is needed here.
See Also