Adding SqlServer DistributedCache breaks perceived tenant features, endpoints, and type definitions. #16046
Unanswered
willnationsdev
asked this question in
Q&A
Replies: 1 comment 5 replies
-
While I won't be able to help with this directly, unfortunately, since several versions ago, OC supports multi-node hosting, including distributed caching, out of the box. So, upgrading would fix this as well. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have an app that we've deployed to dev, test, and prod environments where prod has multiple servers. After noticing seemingly in-memory cache-related bugs exclusively in prod, we realized that we need to add an
IDistributedCache
implementation to fix the issue.It's currently using the 1.3 codebase though we plan to upgrade as soon as the distributed cache issue is resolved. We decided to use
Microsoft.Extensions.Caching.SqlServer
for our distributed cache, like we've done before.I first tried adding it before the
AddOrchardCms()
method and realized that doesn't work because OC'sAddCaching()
method overrides whatever priorIDistributedCache
implementation there may have been with the in-memory one.I then tried the following, which does indeed print both info logs successfully & register the
SqlServerCache
successfully:However, when the app starts, all of the content items stop displaying in the OC admin as if all the data had disappeared. I've confirmed the data is still in the database, and undoing the change makes everything reappear in the GUI.
Why is this happening? And how do I resolve it?
I hope it's just that I'm registering the service incorrectly or that I have to override some sort of default configuration to make OC resume seeing all the existing content.
Edit: it looks like everything has disappeared because the ContentTypeDefinitions have all reverted to a default installation. The custom endpoints from our modules do not appear to be registered properly either (yielding a 404 response) even though the Features section of the tenant shows that the corresponding features are enabled.
Beta Was this translation helpful? Give feedback.
All reactions