Closed kgwadu closed 2 years ago
is it possible that you are using the same redis instance (in case you use redis to sync your nodes) ?
We use redis cache to store data from third party apis (custom implementation), we havent done anything with redis and orchardcore. Will check though if orchard core is somehow using our redis cache for anything.
@sebastienros I can confirm that Orchard Core is storing a bunch of data in our redis cache. We do not have any of the redis features enabled, how do we prevent Orchard Core from using our redis cache??
It can't store in Redis if no redis feature is configured (that's the theory). What kind of data is stored? You could then use this to verify the corresponding feature is really not enabled.
@sebastienros First image is what OC is storing in Redis, the second screenshot is the Redis features.
Re-reading the issue, isn't it normal if your two environments are using the same database? Isn't it the case? These settings are stored in the db (though I am not sure about the content types).
@sebastienros so ultimately the problem is that orchard core is using our redis cache resource even though we havent enabled any features related to redis cache. We have been unsuccessful with trying to find a way to prevent OC from using this.
Thanks for confirming, we need to find someone to debug this. If you want to start the investigation on your side you could add a break point in the REDIS services and see what is invoking it even though the feature is not enabled.
I find it weird though that Orchard is able to store something on Redis if you haven't configured it. How can it be that clever to find your instance? Have you checked OC's configuration files to be sure there isn't any config there?
Yes we have services that inject IDistributedCache
which by default is a MemoryDistributedCache
, same interface but memory only. For example the document manager and the dynamic cache.
Then the redis cache feature is to provide a concrete implementation of a distributed cache, but could be any other feature e.g. providing a cache from a shared database. So yes if you register at the tenant level a custom IDistributedCache
it will then be used.
Idem e.g. if you use the aspnetcore Distributed cache tag helper that will use any current implementation of IDistributedCache
.
Hmm, maybe one solution would be to register at the tenant level your distributed cache before we register the MemoryDistributedCache
so that our services will resolve this last one, we have a startup Order property to control the registrations order at the tenant/modules level.
Then in your code you could inject an IEnumerable<IDistributedCache>
and then only keep your type or filter out the MemoryDistributedCache
.
@sebastienros @jtkech ok so it sounds like the issue is this "So yes if you register at the tenant level a custom IDistributedCache it will then be used.", will try your suggestion regarding order. Thank you.
The default Order value is 0, so normally a value of -1 would be sufficient.
We have noticed a very serious issue where certain changes made on one environment are being pushed to 2 other environments.
We have not noticed this behaviour on any of our other OC websites, any help would be greatly appreciated, this is causing a lot of problems for us.