Interface IRemoteContentCallService
public interface IRemoteContentCallService
Properties
ObservedContentTtl
The content lifetime the server most recently reported on a successful bulk warm-up, or
null when none has succeeded yet. Drives the periodic re-warm interval, so the client
follows the server's TTL instead of guessing at it.
TimeSpan? ObservedContentTtl { get; }
Property Value
Remarks
A default implementation returning null is provided so adding this member does not
break existing implementers of this public interface; a caller that gets null falls
back to its own interval.
Methods
ClearContentCacheAsync()
Task ClearContentCacheAsync()
Returns
GetCacheCountsByLanguage()
Number of currently-cached content entries grouped by language key — i.e. how much content has been loaded so far per language (warm-up + lazy loads). For diagnostics/admin display.
IReadOnlyDictionary<Guid, int> GetCacheCountsByLanguage()
Returns
GetContentAsync(string, string, Guid, ContentFormat?, string, IReadOnlyDictionary<string, string>)
Task<(string Value, bool Success)> GetContentAsync(string key, string defaultValue, Guid languageKey, ContentFormat? contentType, string application = null, IReadOnlyDictionary<string, string> translations = null)
Parameters
keystringdefaultValuestringlanguageKeyGuidcontentTypeContentFormat?applicationstringtranslationsIReadOnlyDictionary<string, string>
Returns
GetContentResultAsync(string, string, Guid, ContentFormat?, string, IReadOnlyDictionary<string, string>)
As GetContentAsync(string, string, Guid, ContentFormat?, string, IReadOnlyDictionary<string, string>), but also reports where the value came from. Prefer this when the caller needs to tell a server value apart from a cached one or a fallback default.
Task<ContentResult> GetContentResultAsync(string key, string defaultValue, Guid languageKey, ContentFormat? contentType, string application = null, IReadOnlyDictionary<string, string> translations = null)
Parameters
keystringdefaultValuestringlanguageKeyGuidcontentTypeContentFormat?applicationstringtranslationsIReadOnlyDictionary<string, string>
Returns
GetLanguagesAsync(bool)
Task<Language[]> GetLanguagesAsync(bool forceReload)
Parameters
forceReloadbool
Returns
GetManyContentAsync(IReadOnlyCollection<ContentRequest>, Guid, ContentFormat?, string)
Resolve a set of keys together. Anything already cached is served from there; a cold language is warmed once in bulk rather than a call per key; only keys the server has genuinely never seen still cost a round trip each, and those no longer block the caller (see MaterializationWait).
Task<IReadOnlyDictionary<string, string>> GetManyContentAsync(IReadOnlyCollection<ContentRequest> requests, Guid languageKey, ContentFormat? contentType, string application = null)
Parameters
requestsIReadOnlyCollection<ContentRequest>languageKeyGuidcontentTypeContentFormat?applicationstring
Returns
Remarks
A default implementation is provided so adding this member does not break existing implementers; it loops the single-key path.
SetContentAsync(string, string, Guid, ContentFormat, string)
Task SetContentAsync(string key, string defaultValue, Guid languageKey, ContentFormat contentType, string application = null)
Parameters
keystringdefaultValuestringlanguageKeyGuidcontentTypeContentFormatapplicationstring
Returns
WarmCacheAsync(Guid, string)
Pre-fill the local cache for an entire application + language in one bulk call (the startup
warm-up). Eliminates the per-key fan-out on cold load. Best-effort: a missing endpoint (old
server, 404), failure, or timeout is swallowed so the normal per-key path still serves
content. application follows the usual convention (null → resolve).
Task WarmCacheAsync(Guid languageKey, string application = null)
Parameters
Returns
WarmConfiguredLanguagesAsync(string)
Warm the default language plus every language named in
WarmUpLanguages in one bulk call each. Used by the startup
warm-up and by "Reload Content". A configured name with no matching server language is
skipped with a Warning. Best-effort throughout, like WarmCacheAsync(Guid, string).
Task WarmConfiguredLanguagesAsync(string application = null)
Parameters
applicationstring