-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Description
This issue was previously raised as a bug but was closed as an intentional change.
Now, only files in _framework folder and appsettings files are compressed.
Regardless, the switch from .net 5 to .net 6 has a subtle breaking change for deployed applications.
Steps to recreate:
-
Using .net 5, deploy a .js file within the "_content" folder.
-
The .br and .gz files will be served when requesting .js file
-
Change the .js file
-
Using .net 6 deploy the same project to the same location
-
The .js file will be changed to the latest version but .br and .gz will remain as older version
-
The .br and .gz files will continue to be served. The changes to .js will be ignored
In addition, the inability to compress all files as part of "dotnet publish" introduces the need for extra scripting to compress files as part of the deploy process. This is particularly important for web applications that depend on large .js or .css files and where there is great pressure to minimize the initial load times of Blazor apps.
Given that there is a project file option to disable compression, perhaps it would be appropriate to add a new option such as:
<CompressAllPublishedFiles>true</CompressAllPublishedFiles>
It certainly is possible to hack the .targets file to compress all files but a more stable solution is required.