Hey all, I wonder if I could get some help, I've found simlar topics on the forum but none fix my situation.
I want to use the static cache in service ProductService, so in DependencyRegistwer I;
builder.RegisterType<ProductService>().As<IProductService>()
.WithParameter(ResolvedParameter.ForNamed<ICacheManager>("nop_cache_static"))
.SingleInstance();
..but every request I get an empty cache again, I tried the above with .InstancPerRequest and .InstanceLifetimeScope but same behaviour, my .Set() always goes to the PerRequestCacheManager not the static one.
Testing it with SettingsService (I think it was, one that has a ForNamed static set up), it uses the static cache fine but however I tinker with the declaration above I can't get ProductService to use the static cache - any ideas please ?
The cache declarations are fine, untouched;
builder.RegisterType<MemoryCacheManager>().As<ICacheManager>().Named<ICacheManager>("nop_cache_static").SingleInstance();
builder.RegisterType<PerRequestCacheManager>().As<ICacheManager>().Named<ICacheManager>("nop_cache_per_request").InstancePerRequest();
...after years of using Nop as the basis for a very changed app, I now realise my cacheing has been fruitless ! - any help much appreciated.
This one is close, but has a hack as the fix :)
https://www.nopcommerce.com/boards/t/27890/bug-or-wrong-debugging-on-nop-caching-cachemanagersetkey-result-cachetime.aspx
Cheers,
Chris
(registered user of NopCommence if that helps/is required, thanks)