diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets
index be1b7214e2c0b..bf01bec5d5625 100644
--- a/src/mono/wasm/build/WasmApp.targets
+++ b/src/mono/wasm/build/WasmApp.targets
@@ -152,6 +152,7 @@
false
_framework
+ true
@@ -449,6 +450,7 @@
WasmIncludeFullIcuData="$(WasmIncludeFullIcuData)"
WasmIcuDataFileName="$(WasmIcuDataFileName)"
RuntimeAssetsLocation="$(WasmRuntimeAssetsLocation)"
+ CacheBootResources="$(BlazorCacheBootResources)"
>
diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs
index 9c7d8a6799134..869feb1277011 100644
--- a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs
+++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs
@@ -27,6 +27,7 @@ public class WasmAppBuilder : WasmAppBuilderBaseTask
public bool WasmIncludeFullIcuData { get; set; }
public string? WasmIcuDataFileName { get; set; }
public string? RuntimeAssetsLocation { get; set; }
+ public bool CacheBootResources { get; set; }
//
// Extra json elements to add to _framework/blazor.boot.json
@@ -102,6 +103,9 @@ protected override bool ExecuteInternal()
globalizationMode = GetGlobalizationMode().ToString().ToLowerInvariant()
};
+ if (CacheBootResources)
+ bootConfig.cacheBootResources = CacheBootResources;
+
// Create app
var runtimeAssetsPath = !string.IsNullOrEmpty(RuntimeAssetsLocation)
? Path.Combine(AppDir, RuntimeAssetsLocation)