Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

3.7 KiB

Configuring for Production

ABP Framework has a lot of options to configure and fine-tune its features. They are all explained their own documents. Default values for these options are pretty well for most of the deployment environments. However, you may need to care about some options based on how you've structured your deployment environment. In this document, we will highlight these kind of options. So, it is highly recommended to read this document to not have unexpected behaviors in your system in production.

Distributed Cache Prefix

ABP's distributed cache infrastructure provides an option to set a key prefix for all of your data saved into your distributed cache provider. The default value of this option is not set (it is null). If you are using a distributed cache server that shared by different applications, then you can set a prefix value to isolate an application's cache data from others.

Configure<AbpDistributedCacheOptions>(options =>
{
    options.KeyPrefix = "MyCrmApp";
});

That's all. ABP, then will add this prefix to all of your cache keys in your application as along as you use ABP's IDistributedCache<TCacheItem> or IDistributedCache<TCacheItem,TKey> services. See the Caching documentation if you are new to the distributed caching.

Warning #1: If you use ASP.NET Core's standard IDistributedCache service, it's your responsibility to add the key prefix (you can get the value by injecting IOptions<AbpDistributedCacheOptions>). ABP can not do it.

Warning #2: Even if you have never used distributed caching in your own codebase, ABP still uses it for some features. So, you should always configure this prefix if your caching server is shared among multiple systems.

Warning #3: If you are building a microservice system, then you will have multiple applications that share the same distributed cache server. In such systems, all applications (or services) normally should use the same cache prefix, because you want all the applications use the same cache data to have consistency between applications.

Warning #4: Some of the ABP's startup templates are pre-configured to set a prefix value for the distributed cache. So, please check your application code if it is already configured.

Distributed Lock Prefix

ABP's distributed locking infrastructure provides an option to set a prefix for all keys you are using in the distributed lock server. The default value of this option is not set (it is null). If you are using a distributed lock server that is shared by different applications, then you can set a prefix value to isolate an application's locks from others.

Configure<AbpDistributedLockOptions>(options =>
{
    options.KeyPrefix = "MyCrmApp";
});

That's all. ABP, then will add this prefix to all of your keys in your application. See the Distributed Locking documentation if you are new to the distributed locking.

Warning #1: Even if you have never used distributed locking in your own codebase, ABP still uses it for some features. So, you should always configure this prefix if your distributed lock server is shared among multiple systems.

Warning #2: If you are building a microservice system, then you will have multiple applications that share the same distributed locking server. In such systems, all applications (or services) normally should use the same lock prefix, because you want to lock your resources globally in your system.

Warning #3: Some of the ABP's startup templates are pre-configured to set a prefix value for the distributed locking. So, please check your application code if it is already configured.