Try our conversational search powered by Generative AI!

Multisite Cache Synchronization

Vote:
 

Hello,

We have two Episerver sites, each using their own IIS site. It's a shared database and single codebase deployed to both IIS sites (and therefore independent Object caches). I've configured the events over WCF as described here (https://world.episerver.com/documentation/developer-guides/CMS/event-management/WCF-event-management/) but the default behavior doesn't seem to give us what we want.

It works successfully for updating the cached representation of a piece of content, however parent items are not updated. For example:

  1. Create a block in a shared folder in site 1.
  2. View folder containing shared block on site 2.
  3. Folder on site 2 does not contain the new block since the cached shared folder hasn’t been updated on site 2.

This can be pretty disruptive to our content editors since they don't know when it will be visible from the other site (due to sliding expiration). I briefly looked into a persistent cache like Redis, but as far as I can tell I would have to update a ton of code to work. For example, a GET from the ContentLoader reads from the default memory cache and wouldn't work with a Redis cache?

Does anyone have any recommendations here for keeping the cache synchronized in a multisite setup? Alternatively, am I better off considering using 1 IIS site for both websites so I don't have to keep the cache in sync?

#253170
Apr 13, 2021 17:46
Vote:
 

Never heard of using different IIS sites for the same codebase and database, we always use just 1. What's the benefit of doing it this way?

#253171
Apr 13, 2021 17:50
Vote:
 

They started out as separate codebases and sites and we ended up merging the code over time. After it was merged I believe we were thinking that separate app pools and IIS sites would prevent a crash from bringing down both sites, but I'm open to considering one IIS site if that is the recommended approach.

#253172
Apr 13, 2021 17:56
Vote:
 

Ideally you don't want to be at a point where you're having crashes that take down the app pool. You should be using correct exception handling and error preventation to make your site stable, it only really makes sense to have 2 sites if they are load balanced, involved in some sort of staggered deployment scenario or you're gating off the CMS to a specific authoring domain. I'd move them to a single instance

#253175
Apr 13, 2021 20:56
Vote:
 

That makes sense. We'll look into doing that, thank you.

#253176
Apr 13, 2021 21:02
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.