Context
As part of the Blazor migration, we vendored CDN dependencies (Bulma, Font Awesome, Chart.js, chartjs-adapter-date-fns) into wwwroot/lib/ to eliminate external requests. Currently these are served from the same origin as the app.
Goal
Serve static assets from a dedicated CDN domain to avoid the browser's 6 concurrent connections per domain limit:
- Production:
cdn.nugettrends.com
- Staging:
staging.cdn.nugettrends.com
- Development: empty (serve locally)
Implementation ideas
- Add a
CdnBaseUrl setting to appsettings.{Environment}.json
- Read it in
App.razor via IConfiguration and prepend to lib/ asset paths
- Update
ExternalDependencyTests to allow requests to the configured CDN host
- Set up CDN infrastructure (e.g. Azure CDN, Cloudflare) pointing to the app's static files
Related
Vendored assets committed in the Blazor frontend branch (wwwroot/lib/).
Context
As part of the Blazor migration, we vendored CDN dependencies (Bulma, Font Awesome, Chart.js, chartjs-adapter-date-fns) into
wwwroot/lib/to eliminate external requests. Currently these are served from the same origin as the app.Goal
Serve static assets from a dedicated CDN domain to avoid the browser's 6 concurrent connections per domain limit:
cdn.nugettrends.comstaging.cdn.nugettrends.comImplementation ideas
CdnBaseUrlsetting toappsettings.{Environment}.jsonApp.razorviaIConfigurationand prepend tolib/asset pathsExternalDependencyTeststo allow requests to the configured CDN hostRelated
Vendored assets committed in the Blazor frontend branch (
wwwroot/lib/).