Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UseStaticFiles does compression on publish with .net9 #59518

Open
1 task done
praxmarer opened this issue Dec 17, 2024 · 2 comments
Open
1 task done

UseStaticFiles does compression on publish with .net9 #59518

praxmarer opened this issue Dec 17, 2024 · 2 comments
Labels
✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question

Comments

@praxmarer
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Hi,

we noticed an increased publish time with .net9. What i found so far is that now in .net9 - static assets compression is happening - even when we do not use the new MapStaticAssets ? We still use UseStaticFiles.

When i set the TargetFramework to net8.0 - and call

dotnet publish BlazorApp1\BlazorApp1.csproj -c Release --self-contained -r linux-musl-x64

build happens without compression

When i set the TargetFramework to net9.0 - without any other changes and do the same - assets are compressed during publish?

Why - i do not find any breaking changes on this topic?

Expected Behavior

No compression happens since we still use UseStaticFiles

Steps To Reproduce

Simply create a new Blazor Web app - Target net8.0 - and call

dotnet publish BlazorApp1\BlazorApp1.csproj -c Release --self-contained -r linux-musl-x64

Then change TargetFramework to net9.0 and do the same

Exceptions (if any)

No response

.NET Version

9.0.101

Anything else?

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Dec 17, 2024
@javiercn
Copy link
Member

@praxmarer thanks for contacting us.

Compression is an SDK feature, it is not affected by what you use at runtime. If you are not taking advantage of it and want to disable it, you can do so with <CompressionEnabled>false</CompressionEnabled> in your csproj file.

@javiercn javiercn added the ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. label Dec 17, 2024
@javiercn javiercn added question and removed area-blazor Includes: Blazor, Razor Components Status: Resolved labels Dec 17, 2024
@praxmarer
Copy link
Author

hi @javiercn - thx, alread did that - but i do not find any documentation about that change in .net9? i am expecting that when still using UseStaticFiles - nothing will change between net8 and net9 ?

Docs https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/static-files?view=aspnetcore-9.0 says:

Static Files Middleware | UseStaticFiles | All .NET versions | Serves static assets to clients without the optimizations of Map Static

So i am really consused currently why when using UseStaticFiles, the Compression is activated. Also, it seems Fingerprinting is also active now - but features are not wanted currently when we UseStaticFiles.

https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-9.0?view=aspnetcore-9.0

This seems also like an breaking change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question
Projects
None yet
Development

No branches or pull requests

2 participants