This is a short but sweet blog post, to let you know about the Umbraco Community Runtime Validators package is out and available for you to use.
This little package came about working with the lovely lot over at Gibe Digital and I suggested that perhaps the code for a specific client project be reused and turned into this project where the wider Umbraco community can benefit from it.
So a BIG thanks to the Gibe development team for peer reviewing the work and collaborating with me on it.
What is an Umbraco Runtime Validator?
This is some code that can run to determine if the Umbraco environment is configured correctly, typically for a Production environment and prevent it from booting and giving you a verbose reason as to why. This makes sure you have all the optimal settings needed to run your Umbraco site in a production environment.
Umbraco ships with the following Runtime Validators to help make your site ready and optimal for use in production.
- JITOptimizer
The application is built and published in Release mode (with JIT optimization enabled) - ModelsBuilderMode
The config value Umbraco:CMS:ModelsBuilder:ModelsMode is set to Nothing - RuntimeMinfication
The config value Umbraco:CMS:RuntimeMinification:CacheBuster is set to a fixed cache buster like Version or AppDomain - UmbracoApplicationUrl
The config value Umbraco:CMS:WebRouting:UmbracoApplicationUrl is configured - UseHttps
The config value Umbraco:CMS:Global:UseHttps is set to true
To learn more about Runtime Validators you can read the official documentation on what they are and how to write your own Umbraco Runtime Validator.
What’s in Umbraco Community Runtime Validators ?
This first release out to the wild, focuses on ensuring your production environment is configured correctly if you are hosting your Umbraco site in Azure in a load balanced environment and ships these Runtime Validators
- AzureLoadBalancing.ExamineValidator
This checks to see if Examine is using the correct LuceneDirectoryFactory - AzureLoadBalancing.HostSyncValidator
This checks to see if the MainDom is configured correctly - AzureLoadBalancing.TempFilesValidator
This checks to see if the LocalTempStorageLocation is set to EnvironmentTemp
Alright already… just tell me how to set it up
Well you can find the package over on Umbraco Marketplace with a lovely readme on how to get setup and running.
But the quick TL:DR version is
dotnet add package Umbraco.Community.RuntimeValidators
Create an Umbraco Composer that updates the RuntimeModeValidators collection
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Community.RuntimeValidators.Validators.AzureLoadBalancing;
using Umbraco.Extensions;
namespace YourProject.Website
public class RuntimeValidatorsComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.RuntimeModeValidators()
.Add<TempFilesValidator>()
.Add<HostSyncValidator>()
.Add<ExamineValidator>();
}
}
Got an idea for a Runtime Validator
Then please submit an issue on the GitHub repository with your super duper fab idea and lets get the conversation going and have a useful community repo of Runtime Validators to make all our Umbraco sites that much better !