Quan Mai
Quan Mai  -  CMS
Apr 30, 2026
visibility 519
star star star star star
(0 votes)

Announcing new library: SettingsManager

When you run .net app, there have been a few ways to store settings. Those can be set via appSettings.json, or via Azure Portal AppService Configuration. However those setting changes require a restart (or even worse, a re-deployment), which is not always something you'd like nor can affort. To support changing settings on a fly, some of our customers have relied on a content approach - by creating a special page containing the settings as properties - which is a nice way to do it, as you have everything you need - you have a nice UI to set the value, you can set the access rights to who can see the settings and who can change them. The settings also support distributed manner, once you publish the page with new property values, the new values will be seen across the instances. 

But that is not without caveats. Reading settings is usually a very hot path, and if you rely on the content API to get the page then the property you need, you could create a severe bottleneck in your website. At best, it creates a lot of unnecessary allocations. At worst it could create infinite loops when you have multiple threads trying to read and write data to cache.

To address those problems, I have created a new library at GitHub - vimvq1987/SettingManager: A setting manager for Optimizely CMS · GitHub as a proof of concept for how you can leverage Content system for settings while avoid those performance issues. I'll eventually submit the nuget package to https://nuget.optimizely.com, but you can start using the library today (just download and build)

What you need to do is to define your content type of setting page, which inherits from SettingsPage

    [ContentType(DisplayName = "Setting page", GUID = "452d1812-7385-42c3-8073-c1b7481e7b22", Description = "", AvailableInEditMode = true)]
    public class MySettingPage : SettingsPage
    {
        public virtual string ASetting { get; set; }
    }

Then register your type you want to use with this in your Startup.cs

services.AddSettingPage<MySettingsPage>()

And then use SettingsManager to get the setting on the fly.

var setting = _settingManager.GetSetting<string>("ASetting");

A setting page will be create per site definition, and you can get site-specific settings. If no site definition is specified, the current site definition will be used.

Settings will be cached and will be automatically cleared if you making change to the page (by changing properties and publish). This works across instance.

As I said this is a pretty much POC, so I'll be happy to receive comments, suggestions, bug reports or fixes to the repository.

Happy coding!

Apr 30, 2026

Comments

error Please login to comment.
Latest blogs
Integrating a Third-Party DAM into Optimizely CMS 12: A Case Study

There is no handbook for wiring an external DAM into Optimizely CMS 12. This case study walks through the research, dead ends, and breakthroughs —...

WilliamP | Jul 7, 2026 |

Ringing a Physical Sales Bell from Optimizely Commerce

This one started as a weekend project that got a little out of hand. I built an “On Air” sign for my office — one of those LED signs streamers use ...

KennyG | Jul 6, 2026

Exploring Asset Lifecycle Management Approaches for Bynder and Optimizely SaaS CMS

Note: This is Part 3 of our Bynder integration series. For setup and filtering prerequisites, see Part 1  and  Part 2 . Introduction In my previous...

Vipin Banka | Jul 5, 2026

Unlock AI-Ready Experiences with Optimizely

Over the past few months, almost every customer conversation has shifted from SEO to AI readiness. The questions are no longer just: “How do we......

Madhu | Jul 5, 2026 |

Planning Your Bynder DAM and Optimizely SaaS CMS Integration the Right Way: Avoiding Asset Sprawl and Unnecessary Synchronization

Note: This is Part 2 of our Bynder integration series. If you missed the Part 1, check out " Implementing the Bynder DAM Connector with Optimizely...

Vipin Banka | Jul 4, 2026

Implementing the Bynder DAM Connector with Optimizely SaaS CMS: Lessons Learned

What I learned while integrating Bynder DAM with Optimizely SaaS CMS, exploring Optimizely Graph, and building a headless frontend experience....

Vipin Banka | Jul 3, 2026