Dev guideRecipesAPI ReferenceChangelog
Dev guideRecipesUser GuidesNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev guide

Performance optimization

Optimize the integration performance between Content Management System 12 (CMS 12) and Optimizely Graph.

Optimize the performance of your Optimizely Content Management System 12 (CMS 12) and Optimizely Graph integration. Improve indexing efficiency and manage system load through batching configuration and content filtering. Use these techniques when high content volumes, frequent updates, or large media assets put pressure on the indexing pipeline.

Configure batching

Batching groups content items so the system indexes them together rather than one at a time. This approach improves throughput and reduces the frequency of indexing operations, which lowers load on both CMS 12 and Optimizely Graph.

Configure batching behavior

Configure batching parameters in the AddContentGraph method.

services.AddContentGraph(options =>
{
    options.BufferedIndexingGracePeriod = 10000; // 10 seconds in milliseconds
    options.MaxBatchSize = 100; // Maximum items per batch
});
  • BufferedIndexingGracePeriod – Defines the time window (in milliseconds) during which content items are buffered before being indexed.
  • MaxBatchSize – Defines the maximum number of items processed per batch during indexing.

Configure event indexing options

Configure how referencing content and synchronization tasks behave during indexing.

services.Configure<EventIndexingOptions>(options =>
{
    options.IndexReferencingContent = ReferencingPropertyTypes.Inlined;
    options.SyncContentsInParallelTaskAndForget = false; // Synchronous processing for better control
});
  • IndexReferencingContent – Determines how the system indexes referenced content. Setting this to Inlined includes references within the main content.
  • SyncContentsInParallelTaskAndForget – Controls synchronization mode. Setting this to false enables synchronous indexing, which improves consistency and control.

Filter content

Improve indexing performance by filtering out unnecessary or large content before Optimizely Graph processes it. Filtering reduces the volume of data the indexing pipeline handles and prevents oversized media from slowing down sync operations.

Implement a content filtering module

The following example skips large binary content or temporary content during the save event.

public class ContentFilteringModule : IInitializableModule
{
    public void Initialize(InitializationEngine context)
    {
        var events = context.Locate.Advanced.GetInstance<IContentEvents>();
        
        events.SavingContent += (sender, args) =>
        {
            // Skip binary content larger than 10 MB
            if (args.Content is MediaData media && media.BinaryData?.Length > 10 * 1024 * 1024)
            {
                // Use exclude attribute or custom logic to prevent indexing
                return;
            }
            
            // Skip temporary content
            if (args.Content.Name.StartsWith("__temp"))
            {
                // Prevent saving or mark for exclusion
                return;
            }
        };
    }
}

This configuration confirms that only relevant and appropriately sized content reaches the index, which reduces unnecessary load on the indexing pipeline.