You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Instead of only using first event, we combine events of same type into a single event with multiple arguments
* Added generic method to DRY up grouping logic.
* Renamed method to better reflect new functionality.
Co-authored-by: Andy Butland <[email protected]>
// When it comes to content types types, a change to any single one will trigger a reload of the content and media caches.
69
-
// As far as I (AB) can tell, there's no type specific logic here, they all clear caches for all content types, and trigger a reload of all content and media.
70
-
// We also have events registered for Changed and Saved, which do the same thing, so really only need one of these.
71
-
// Hence if we have more than one document or media types, we can and should only handle one of the events for one, to avoid repeated cache reloads.
72
-
foreach(vareinGetReducedEventList(events))
72
+
// We can reduce the impact of that by grouping the events to invoke just one per type, providing a collection of the individual arguments.
73
+
vargroupedEvents=GetGroupedEventList(events);
74
+
foreach(vareingroupedEvents)
73
75
{
74
76
varhandler=FindHandler(e);
75
77
if(handler==null)
@@ -86,47 +88,77 @@ public void HandleEvents(IEnumerable<IEventDefinition> events)
0 commit comments