Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
I am not sure but I think the content events are only local - they are not raised on remote instances like cache invalidation
Hi Stepan
Maybe you're not moving the page.
From memory, moved event will only be triggered if you change current parent's parent including moved to wastebasket. The event will not get fired for the children of the page being moved.
I can confirm the content events are local. If you want to raise/listen to them remotely, you will need something like this episerver/content-events-masstransit (github.com)
We have a singleton service which subscribes to
PublishedContent
andMovedContent
fromIContentEvents
. And this works as expected locally, when the CMS is running in a single IIS application. When the app is deployed in multiple load balanced IIS applications, we use EPiServer.Azure, which works as expected for propagating changes from CMS like publishing of new pages to every instance. But we are not getting any published or moved content events in the singleton service in this envirnoment.example from Startup.cs
public void ConfigureServices(IServiceCollection services) { ... services.AddCms(); ... services.AddSignleton<MyService>(); ... services.AddAzureEventProvider(o => { o.ConnectionString = _configuration.GetValue<string>("AzureEventBus:ConnectionString"); o.TopicName = _configuration.GetValue<string>("AzureEventBus:Topic"); o.EnablePartitioning = false; o.TopicSize = 1024; // 1GB }); ...
from MyService.cs
public class MyService { public NavigationBuilder(IContentEvents contentEvents) { contentEvents.PublishedContent += OnContentUpdated; contentEvents.MovedContent += OnContentUpdated; } private void OnContentUpdated(object sender, ContentEventArgs e) { // do something; gets called on local; never called in load balanced env } }