Closed hermesramos closed 7 years ago
@hermesramos Is there any other way but web.config to define a custom OutputCacheProvider
? If so, please let me know, couldn't find anything.
If you cannot configure it by code, I can also not inject anything to it by code. Which means, sorry, this is not possible.
Do you know if it is possible to only set the outputcache in the web.config and set the remaining configuration in the c# (redis and stuff)?
As of know, because of the output cache, I am setting everying in the web.config.
Thanks in advance
Thats what I meant, there is no way to easily connect the two things, I have no control over when the outputcache thing gets initialized to inject a CacheManager instance which was created in your startup code. Would eventually be possible to do via static property or something, but that would be such a horrible design that I'm not willing to implement it ;)
Sorry for my poor english, I was not clear enough.
Can I combine configuration from C# , like bellow, with outputcache from web.config?
var cache = CacheFactory.Build<string>("myCacheName", settings =>
{
settings
.WithSystemRuntimeCacheHandle("handle1")
.And
.WithRedisCacheHandle("redis");
});
with
<system.web>
<caching>
<outputCache defaultProvider="CacheManagerOutputCacheProvider">
<providers>
<add cacheName="myCacheName" name="CacheManagerOutputCacheProvider" type="CacheManager.Web.CacheManagerOutputCacheProvider, CacheManager.Web" />
</providers>
</outputCache>
</caching>
</system.web>
will this work? I tried but could not make it work
np ;) As I said, nope, that's not going to work
Alright! Thank you very much for your time.
Please!
THanks