/// <summary> /// Determines whether to append a dns-prefetch link tag to the document head for each configured cdn provider /// </summary> /// <param name="builder">the builder options</param> /// <param name="enabled">Sets whether to apply the dns-prefetch tags</param> /// <returns>the current builder options</returns> public static ICdnOptionsBuilder ApplyDnsPrefetchTags(this ICdnOptionsBuilder builder, bool enabled = true) { if (enabled) { builder.Services.AddSingleton <ITagHelperComponent, CdnDnsFetchTagHelperComponent>(); } return(builder); }
/// <summary> /// Optionally specifies a custom implementation of <see cref="CdnUriProvider"/> used to process resource uri's into cdn uri's /// </summary> /// <remarks>ONly for advanced custom usage scenarios</remarks> /// <typeparam name="TCdnUriProvider">A class that generates a cdn uri</typeparam> /// <param name="builder">the options builder</param> /// <returns>the current options builder</returns> public static ICdnOptionsBuilder UsingCdnUriProvider <TCdnUriProvider>(this ICdnOptionsBuilder builder) where TCdnUriProvider : CdnUriProvider { builder.Services.AddSingleton <ICdnUriProvider, TCdnUriProvider>(); return(builder); }