Table of Contents

Class ContentOptions

Namespace
Quilt4Net.Toolkit
Assembly
Quilt4Net.Toolkit.dll

This option can be configured by code or with appsettings.json on location "Quilt4Net/Content"

public record ContentOptions : IEquatable<ContentOptions>
Inheritance
ContentOptions
Implements
Inherited Members

Properties

AdminRoles

Roles that grant content admin access (edit, debug, reload). Checked against the authenticated user's claim roles (e.g. Entra ID). Default is ["ContentAdmin", "Developer"].

public string[] AdminRoles { get; set; }

Property Value

string[]

ApiKey

Api key to be used for calls to the server. This key can be retrieved from https://quilt4net.com/.

public string ApiKey { get; set; }

Property Value

string

Application

Name of the application that will be used in Quilt4Net. Default is the name of the assembly.

public string Application { get; set; }

Property Value

string

AssumeAdmin

When true, always grant content admin access regardless of authentication state. Useful during development when no identity provider is configured. Default is false.

public bool AssumeAdmin { get; set; }

Property Value

bool

FailureCacheDuration

Duration to cache the stale or default value when an API call fails (e.g. server unreachable, invalid API key). Only used when no prior successful response TTL is available. Default is 10 minutes (matching the server's default content TTL).

public TimeSpan FailureCacheDuration { get; set; }

Property Value

TimeSpan

HttpTimeout

Timeout for HTTP calls to the Quilt4Net server. Default is 5 seconds. When a stale cached value exists and StaleWhileRevalidate is enabled, the caller gets the stale value immediately and the refresh happens in the background, so this timeout only blocks when no cached value exists. When StaleWhileRevalidate is disabled, an expired entry is refreshed synchronously and this timeout applies to that call.

public TimeSpan HttpTimeout { get; set; }

Property Value

TimeSpan

Quilt4NetAddress

Address to the Quilt4Net server. Default is https://quilt4net.com/. Defaulted on the type so an unbound IOptions<ContentOptions> still carries a usable URL when only part of the toolkit is registered (e.g. AddQuilt4NetRemoteConfiguration without AddQuilt4NetContent).

public string Quilt4NetAddress { get; set; }

Property Value

string

SlowLogThreshold

Diagnostics (issue #132): when a content fetch or language-list load from the server takes at least this long, a single Warning is logged naming the endpoint, elapsed time and HTTP status — so slow content/language loads surface in production even when Debug logging is off. The detailed per-resolution timing lines (key, resolved language, cache hit/miss, source, elapsed) are logged at Debug on category Quilt4Net.Toolkit.Features.Content.RemoteContentCallService and are opt-in via normal log configuration. Set Zero to disable the slow-load warning. Default is 3 seconds.

public TimeSpan SlowLogThreshold { get; set; }

Property Value

TimeSpan

StaleWhileRevalidate

When true (default), an expired cache entry is returned immediately and refreshed in the background (stale-while-revalidate) — fast, but the caller may see one slightly stale value. When false, an expired entry is refreshed synchronously so the caller always gets a fresh value (subject to HttpTimeout), at the cost of blocking on the refresh.

public bool StaleWhileRevalidate { get; set; }

Property Value

bool

WarmUpEnabled

When true (default), the Blazor content registration runs a startup warm-up that pre-fills the cache with the default language in one bulk call (so pages render without a request per key). The user's selected language is warmed per-circuit when it differs from the default. Set false to disable warm-up and rely solely on lazy per-key fetching.

public bool WarmUpEnabled { get; set; }

Property Value

bool

WarmUpLanguages

Additional languages to warm at startup (and on "Reload Content"), on top of the default language which is always warmed. Identified by language name exactly as entered on the server (e.g. ["English", "Svenska"]), matching the naming convention used elsewhere in the content API. A name with no matching server language is skipped with a Warning. Empty (the default) preserves the previous behaviour — only the default language is warmed at startup, and other languages warm per-circuit when first selected. Ignored when WarmUpEnabled is false.

public IReadOnlyList<string> WarmUpLanguages { get; set; }

Property Value

IReadOnlyList<string>