We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OutputCache
EvictCacheAsync()
Hi @myquay
The issue occurs if OutputCache is used alongside your library.
This is an odd one which has me stumped - I've attached a minimal project to demonstrate
When you configure the OutputCache outside the tenant container
builder .Services .AddOutputCache(options => options .AddBasePolicy(config => config.Tag("TagA").Expire(TimeSpan.FromSeconds(10))) );
This sets up a singleton for the IOutputCacheStore as follows:
IOutputCacheStore
public static IServiceCollection AddOutputCache(this IServiceCollection services) { ArgumentNullException.ThrowIfNull(services); services.AddTransient<IConfigureOptions<OutputCacheOptions>, OutputCacheOptionsSetup>(); services.TryAddSingleton<ObjectPoolProvider, DefaultObjectPoolProvider>(); services.TryAddSingleton<IOutputCacheStore>(sp => { var outputCacheOptions = sp.GetRequiredService<IOptions<OutputCacheOptions>>(); return new MemoryOutputCacheStore(new MemoryCache(new MemoryCacheOptions { SizeLimit = outputCacheOptions.Value.SizeLimit })); }); return services; }
But when you evict the cache using it's tag inside the tenant container as follows:
public void Handle() { _cacheStore.EvictByTagAsync("TagA", CancellationToken.None); }
The _cacheStore is always empty. I checked the hashcode in the Post handler and my command handler and it looks like the same instance
When commenting out the Multitenant container and calling the Handle() normally in the main service container it works fine.
Here the minimal project
WebApplication1.zip
The text was updated successfully, but these errors were encountered:
EventCacheAsync()
No branches or pull requests
Hi @myquay
The issue occurs if OutputCache is used alongside your library.
This is an odd one which has me stumped - I've attached a minimal project to demonstrate
When you configure the OutputCache outside the tenant container
This sets up a singleton for the
IOutputCacheStore
as follows:But when you evict the cache using it's tag inside the tenant container as follows:
The _cacheStore is always empty. I checked the hashcode in the Post handler and my command handler and it looks like the same instance
When commenting out the Multitenant container and calling the Handle() normally in the main service container it works fine.
Here the minimal project
WebApplication1.zip
The text was updated successfully, but these errors were encountered: