Skip to content

Commit 7c93ffd

Browse files
authored
[Pre4] Preloaded Blazor framework assets (#35376)
1 parent 38acfdf commit 7c93ffd

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

aspnetcore/blazor/fundamentals/static-files.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,30 @@ For general information on serving static files with Map Static Assets routing e
2020

2121
:::moniker-end
2222

23+
:::moniker range=">= aspnetcore-10.0"
24+
25+
## Preloaded Blazor framework static assets
26+
27+
In Blazor Web Apps, framework static assets are automatically preloaded using [`Link` headers](https://developer.mozilla.org/docs/Web/HTTP/Reference/Headers/Link), which allows the browser to preload resources before the initial page is fetched and rendered.
28+
29+
In standalone Blazor WebAssembly apps, framework assets are scheduled for high priority downloading and caching early in browser `index.html` page processing when:
30+
31+
* The `OverrideHtmlAssetPlaceholders` MSBuild property in the app's project file (`.csproj`) is set to `true`:
32+
33+
```xml
34+
<PropertyGroup>
35+
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
36+
</PropertyGroup>
37+
```
38+
39+
* The following `<link>` element containing [`rel="preload"`](https://developer.mozilla.org/docs/Web/HTML/Reference/Attributes/rel/preload) is present in the `<head>` content of `wwwroot/index.html`:
40+
41+
```html
42+
<link rel="preload" id="webassembly" />
43+
```
44+
45+
:::moniker-end
46+
2347
## Static asset delivery in server-side Blazor apps
2448

2549
:::moniker range=">= aspnetcore-9.0"

aspnetcore/release-notes/aspnetcore-10/includes/blazor.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,20 @@ The following synchronous methods are available on <xref:Microsoft.JSInterop.IJS
351351
352352
For more information, see the following sections of the *Call JavaScript functions from .NET methods* article:
353353
354-
* [Create an instance of a JS object using a constructor function](xref:blazor/js-interop/call-javascript-from-dotnet#create-an-instance-of-a-js-object-using-a-constructor-function)
355-
* [Read or modify the value of a JS object property](xref:blazor/js-interop/call-javascript-from-dotnet#read-or-modify-the-value-of-a-js-object-property)
354+
* [Create an instance of a JS object using a constructor function](xref:blazor/js-interop/call-javascript-from-dotnet?view=aspnetcore-10.0#create-an-instance-of-a-js-object-using-a-constructor-function)
355+
* [Read or modify the value of a JS object property](xref:blazor/js-interop/call-javascript-from-dotnet?view=aspnetcore-10.0#read-or-modify-the-value-of-a-js-object-property)
356356
357357
### Blazor WebAssembly performance profiling and diagnostic counters
358358
359359
New performance profiling and diagnostic counters are available for Blazor WebAssembly apps. For more information, see the following articles:
360360
361-
* <xref:blazor/performance/webassembly-browser-developer-tools>
362-
* <xref:blazor/performance/webassembly-event-pipe>
361+
* <xref:blazor/performance/webassembly-browser-developer-tools?view=aspnetcore-10.0>
362+
* <xref:blazor/performance/webassembly-event-pipe?view=aspnetcore-10.0>
363+
364+
## Preloaded Blazor framework static assets
365+
366+
In Blazor Web Apps, framework static assets are automatically preloaded using [`Link` headers](https://developer.mozilla.org/docs/Web/HTTP/Reference/Headers/Link), which allows the browser to preload resources before the initial page is fetched and rendered. In standalone Blazor WebAssembly apps, framework assets are scheduled for high priority downloading and caching early in browser `index.html` page processing.
367+
368+
For more information, see <xref:blazor/fundamentals/static-files?view=aspnetcore-10.0#preloaded-blazor-framework-static-assets>.
363369
364370
-->

0 commit comments

Comments
 (0)