Skip to content

Commit

Permalink
Merge pull request #829 from unoplatform/dev/eb/no-prefetch
Browse files Browse the repository at this point in the history
perf: Fully disable prefetching
  • Loading branch information
ebariche authored Mar 5, 2024
2 parents f9ea17f + a7b60b5 commit b1bc52b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
10 changes: 5 additions & 5 deletions build/ci/gitversion.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
steps:
- task: UseDotNet@2
displayName: 'Use .Net Core runtime 3.1.x'
displayName: 'Use .NET'
inputs:
packageType: runtime
version: 3.1.3
version: 5.0.3

- task: UseDotNet@2
displayName: 'Use .Net Core runtime 5.0.3'
displayName: 'Use .NET'
inputs:
packageType: runtime
version: 5.0.3
version: 6.0.0

- task: gitversion/setup@0
inputs:
versionSpec: '5.6.6'
versionSpec: '5.10.3'

- task: gitversion/execute@0
inputs:
Expand Down
11 changes: 4 additions & 7 deletions src/Uno.Wasm.Bootstrap/ShellTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,7 @@ private void GenerateEmbeddedJs()

private void GeneratePrefetchHeaderContent(StringBuilder extraBuilder)
{
if (_shellMode == ShellMode.Browser)
if (_shellMode == ShellMode.Browser && GeneratePrefetchHeaders)
{
extraBuilder.AppendLine($"<link rel=\"prefetch\" href=\"{WebAppBasePath}uno-config.js\" />");
extraBuilder.AppendLine($"<link rel=\"prefetch\" href=\"{WebAppBasePath}dotnet.js\" />");
Expand All @@ -2298,13 +2298,10 @@ private void GeneratePrefetchHeaderContent(StringBuilder extraBuilder)
extraBuilder.AppendLine($"<link rel=\"prefetch\" href=\"{WebAppBasePath}dotnet.native.js\" />");
extraBuilder.AppendLine($"<link rel=\"prefetch\" href=\"{WebAppBasePath}dotnet.runtime.js\" />");

if (GeneratePrefetchHeaders)
var distName = Path.GetFileName(_managedPath);
foreach (var file in Directory.GetFiles(_managedPath, "*.clr", SearchOption.AllDirectories))
{
var distName = Path.GetFileName(_managedPath);
foreach (var file in Directory.GetFiles(_managedPath, "*.clr", SearchOption.AllDirectories))
{
extraBuilder.AppendLine($"<link rel=\"prefetch\" href=\"{WebAppBasePath}{distName}/{Path.GetFileName(file)}\" />");
}
extraBuilder.AppendLine($"<link rel=\"prefetch\" href=\"{WebAppBasePath}{distName}/{Path.GetFileName(file)}\" />");
}
}
}
Expand Down

0 comments on commit b1bc52b

Please sign in to comment.