Is the recommended way to deal with this to set the App SelfUrl to https://{{tenantName}}.app.mydomainhere.com
Yes, this is the recommended way.
but i want to know if this configuration affect the performance of project
Yes, it may have some effect
and AbsoluteExpirationRelativeToNow refresh cache every 60 seconds or when i update permission it takes 60 seconds for the web to refresh
Yes, refresh every 60 seconds.
If you care about performance and want to refresh the web permission immediately, You can consider manually deleting the cache using Redis API.
In the HttpApi.Host project
public class MvcCurrentApplicationConfigurationCacheResetEventHandler :
ILocalEventHandler<CurrentApplicationConfigurationCacheResetEventData>,
ITransientDependency
{
protected IConfiguration Configuration { get; }
public MvcCurrentApplicationConfigurationCacheResetEventHandler(IConfiguration configuration)
{
Configuration = configuration;
}
public virtual async Task HandleEventAsync(CurrentApplicationConfigurationCacheResetEventData eventData)
{
var redis = await ConnectionMultiplexer.ConnectAsync(Configuration["Redis:Configuration"]!);
redis.GetDatabase().KeyDeleteAsync(...)
// remove all application configuration caches.
}
}
MvcCachedApplicationConfigurationClient
How do I ensure, in the user application (Angular UI), the application stays in localhost:4200 and does not navigate to Auth server page?
I think this may have something to do with your ABP angular version. You can check if these are helpful.
https://docs.abp.io/en/abp/latest/UI/Angular/Account-Module#my-account-page https://docs.abp.io/en/commercial/latest/modules/account#angular-ui
Also, how do I to hide "Security Logs" from profile menu
https://docs.abp.io/en/abp/latest/UI/Angular/Modifying-the-Menu#how-to-patch-or-remove-a-navigation-element
You can remove Security Logs
from routes, the name is : eAccountRouteNames.MySecurityLogs
and also need to customize the My Account page UI?
Yes, you need to customize the UI: https://docs.abp.io/en/abp/latest/UI/Angular/Component-Replacement
Hi,
Ok, your ticket was refunded.
It looks like a bug, I will check it
Hi,
For the Tiered
solution:
The MVC application loads the application configuration(permissions, settings... etc from remote(HttpApi.Host) and store it in the Redis cache. by default, the cache time is 5 mins.
That's why let you use this class because it changes the cache time to 20s(you can use any time span you want.)
Maybe I misunderstood something, please let me know.
Hi,
You can configure the ApplicationConfigurationDtoCacheAbsoluteExpiration
:
https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientCacheOptions.cs
But it was added in version 7.1
, if you don't want to upgrade your project version. you need to replace the MvcCachedApplicationConfigurationClient
service:
[ExposeServices(typeof(ICachedApplicationConfigurationClient))]
public class MyMvcCachedApplicationConfigurationClient : ICachedApplicationConfigurationClient, ITransientDependency
{
protected IHttpContextAccessor HttpContextAccessor { get; }
protected AbpApplicationConfigurationClientProxy ApplicationConfigurationAppService { get; }
protected ICurrentUser CurrentUser { get; }
protected IDistributedCache<ApplicationConfigurationDto> Cache { get; }
public MyMvcCachedApplicationConfigurationClient(
IDistributedCache<ApplicationConfigurationDto> cache,
AbpApplicationConfigurationClientProxy applicationConfigurationAppService,
ICurrentUser currentUser,
IHttpContextAccessor httpContextAccessor)
{
ApplicationConfigurationAppService = applicationConfigurationAppService;
CurrentUser = currentUser;
HttpContextAccessor = httpContextAccessor;
Cache = cache;
}
public async Task<ApplicationConfigurationDto> GetAsync()
{
var cacheKey = CreateCacheKey();
var httpContext = HttpContextAccessor?.HttpContext;
if (httpContext != null && httpContext.Items[cacheKey] is ApplicationConfigurationDto configuration)
{
return configuration;
}
configuration = await Cache.GetOrAddAsync(
cacheKey,
async () => await ApplicationConfigurationAppService.GetAsync(),
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(20) // the cache time
}
);
if (httpContext != null)
{
httpContext.Items[cacheKey] = configuration;
}
return configuration;
}
public ApplicationConfigurationDto Get()
{
var cacheKey = CreateCacheKey();
var httpContext = HttpContextAccessor?.HttpContext;
if (httpContext != null && httpContext.Items[cacheKey] is ApplicationConfigurationDto configuration)
{
return configuration;
}
return AsyncHelper.RunSync(GetAsync);
}
protected virtual string CreateCacheKey()
{
return MvcCachedApplicationConfigurationClientHelper.CreateCacheKey(CurrentUser);
}
}
Hi,
May I ask your project type:
Hi,
It looks like a bug, we will fix it in the next patch version. your ticket was refunded.