DeviceApi Configurations. To change the default configs of the DeviceAtlas DeviceApi create an instance of this class, set your preferred configs and pass the instance to the constructor of a DeviceApi or DeviceApiWeb. Note that you may change the configs even after the Config instance has been passed to the DeviceApi.
More...
|
const string | DEFAULT_COOKIE_NAME = "DAPROPS" |
| The default cookie name that the client side properties would be set to. When using the GetProperties() or GetProperty() of class DeviceApiWeb, the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages. More...
|
|
const int | DEFAULT_MAX_CACHE_ENTRIES = 4096 |
| The default config value for result (Properties object) caching. Depending on the repeat and distance factor of your user-agents or headers passed to the API for detection the result cache may increase performance by preventing repeated lookups. More...
|
|
|
virtual string | CookieName [get, set] |
| To change the cookie name that the client side properties would be set to. When using the GetProperties() or GetProperty() of class DeviceApiWeb, the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages.
When the user-agent or HTTP headers are set manually to GetProperties() or GetProperty(), the client side properties (probably the value set to the cookie) can be manually passed to this methods as the second argument, note that this config is only used for GetProperties(REQUEST-OBJECT) or GetProperty(REQUEST-OBJECT). More...
|
|
virtual int | MaxCacheEntries [get, set] |
| Set the max number of results to be cached. Depending on the repeat and distance factor of your user-agents or headers passed to the API for detection, increasing the result cache may increase performance by preventing repeated lookups. For a tight set of inputs (i.e. an almost unique set of user-agents) set to lower numbers or o to disable. More...
|
|
virtual int | CacheConcurrencyLevel [get, set] |
| The cache uses a ConcurrentDictionary as an in-memory data store, the higher the concurrency level, the higher the theoretical number of operations that could be performed concurrently on the ConcurrentDictionary. If not set, the default concurrency level will be set the number of processors that are available (Environment.ProcessorCount). More...
|
|
DeviceApi Configurations. To change the default configs of the DeviceAtlas DeviceApi create an instance of this class, set your preferred configs and pass the instance to the constructor of a DeviceApi or DeviceApiWeb. Note that you may change the configs even after the Config instance has been passed to the DeviceApi.
- Author
- DeviceAtlas Limited
- Copyright
- Copyright (c) DeviceAtlas Limited 2023. All Rights Reserved.
◆ Config()
Com.DeviceAtlas.Device.Config.Config |
( |
| ) |
|
|
inline |
◆ DEFAULT_COOKIE_NAME
const string Com.DeviceAtlas.Device.Config.DEFAULT_COOKIE_NAME = "DAPROPS" |
The default cookie name that the client side properties would be set to. When using the GetProperties() or GetProperty() of class DeviceApiWeb, the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages.
◆ DEFAULT_MAX_CACHE_ENTRIES
const int Com.DeviceAtlas.Device.Config.DEFAULT_MAX_CACHE_ENTRIES = 4096 |
The default config value for result (Properties object) caching. Depending on the repeat and distance factor of your user-agents or headers passed to the API for detection the result cache may increase performance by preventing repeated lookups.
◆ CacheConcurrencyLevel
virtual int Com.DeviceAtlas.Device.Config.CacheConcurrencyLevel |
|
getset |
The cache uses a ConcurrentDictionary as an in-memory data store, the higher the concurrency level, the higher the theoretical number of operations that could be performed concurrently on the ConcurrentDictionary. If not set, the default concurrency level will be set the number of processors that are available (Environment.ProcessorCount).
- Parameters
-
cacheConcurrencyLevel | concurrency level for the ConcurrentDictionary powering the cache |
◆ CookieName
virtual string Com.DeviceAtlas.Device.Config.CookieName |
|
getset |
To change the cookie name that the client side properties would be set to. When using the GetProperties() or GetProperty() of class DeviceApiWeb, the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages.
When the user-agent or HTTP headers are set manually to GetProperties() or GetProperty(), the client side properties (probably the value set to the cookie) can be manually passed to this methods as the second argument, note that this config is only used for GetProperties(REQUEST-OBJECT) or GetProperty(REQUEST-OBJECT).
- Parameters
-
cookieName | The cookie name which the client side properties are set to Set to null to turn off using client-side properties. |
◆ MaxCacheEntries
virtual int Com.DeviceAtlas.Device.Config.MaxCacheEntries |
|
getset |
Set the max number of results to be cached. Depending on the repeat and distance factor of your user-agents or headers passed to the API for detection, increasing the result cache may increase performance by preventing repeated lookups. For a tight set of inputs (i.e. an almost unique set of user-agents) set to lower numbers or o to disable.
- Parameters
-
maxCacheEntries | max number of cache entries |
The documentation for this class was generated from the following file:
- Src/API/Com/DeviceAtlas/Device/Config.cs