aws / aws-dotnet-deploy

Opinionated tooling that simplifies deployment of .NET applications to AWS.
https://aws.github.io/aws-dotnet-deploy/
Apache License 2.0
137 stars 31 forks source link

Blazor WASM deployed to Cloudfront on url downloads 70 dlls, but Cloudfront url only downloads 20 #46152 #747

Closed mtrtm closed 1 year ago

mtrtm commented 1 year ago

Describe the bug

I posted this over here: https://github.com/dotnet/aspnetcore/issues/46152 but am reposting this since it may be a better forum

I deployed my MudBlazor wasm app to AWS Cloudfront. I am still on dotnet6 at the moment, and found that AOT made both desktop and mobile VERY slow (45-60 second load time on mobile, about half that time on desktop) so I shut that off for now.

What is weird is that if I use browser tools and disable cache, when loading locally my app is less than 2 mb and loads blazingly fast. When I deploy to cloudfront, if I go to the cloudfront url, it's a lot bigger and slower. When I point my A/AAAA records to cloudfront, I get even more files still.

I was quite pleased by local performance - I thought that a debug build with less than 2 mb would be even faster when deployed - can someone help me troubleshoot? image

Expected Behavior

I would expect a deployment (with and without AOT compile) to be smaller and faster than running locally

Current Behavior

Get 70 files totaling 50 mb

Reproduction Steps

Create Mudblazor project/sln using cli: dotnet new --install MudBlazor.Templates dotnet new mudblazor --host wasm --name MyApplication

Deploy to AWS using https://aws.github.io/aws-dotnet-deploy/ - so from your blazor folder in the cli> dotnet aws deploy

Add A/AAAA records to point to the cloudfront distro

Locally: view very small and fast (full production app < 2 mb for me) Cloudfront url: about the same number of files, but twice as large (still decently fast, though) Actual url pointing to cloudfront: 70 files, 50 mb

Possible Solution

No response

Additional Information/Context

No response

Version used

1.10.4+e8f4ad1dc0

Operating System and version

win 10

mtrtm commented 1 year ago

Now that I have done more testing I can't reproduce what I was seeing

github-actions[bot] commented 1 year ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.