Slow app load because dotnet.wasm not cached for AOT and InterpreterAOT builds - uno-platform

I'm trying to improve the load time performance of my Uno Platform WASM app. It's hosted on an IIS/10.0 Server. When I do a browser reload on page that hosts a <WasmShellMonoRuntimeExecutionMode>Interpreter</WasmShellMonoRuntimeExecutionMode> build of this app, I can see in the browser's network log that it's pulling dotnet.wasm from the browser's cache:
However, when I do a browser reload on page that hosts a <WasmShellMonoRuntimeExecutionMode>InterpreterAndAOT</WasmShellMonoRuntimeExecutionMode> or <WasmShellMonoRuntimeExecutionMode>FullAOT</WasmShellMonoRuntimeExecutionMode> build, it always pulls the file from the server:
I've tried this on Chrome, Edge, Edge Beta, FireFox, and Opera - all with the same result.
All builds have the same web.config file in their root directory.
EDIT 1: The web.config file is the one from Uno Template (unmodified).
EDIT 2: I should also note that since initially posting this question I found that it appears web.config is working with IIS Express and Azure Web App Service (the compressed versions of the app files are being served AND dotnet.wasm is cached by the browser) - but not IIS Server on a Windows 10 Server (the compressed versions of the app files are NOT being served AND dotnet.wasm is NOT being cached by the browser).
Is there something I'm missing in my build configuration that's triggering this behavior?

The Uno Platform app template provides a web.config file that enables compression, and avoids this kind of issues.
That web.config file uses the IIS URL rewriting module and brotli/gzip compression to make assets download a lot faster.

Related

Azure App Services Reloading site instead of css files

Ok odd one.
I have deployed an example angular application to Azure App Services.
This has worked.. but the styles are failing to load, and on checking
https://angularoptimized.azurewebsites.net/styles.7ade3819d0791222.css
This fails to load, it is redirecting to the main site.. not failing? I can confirm the file exists. And in case it matters, there are also compressed versions available on the server so wondering if this is being interpreted weirdly??
If checked in a browser, its not identifying the call as a style sheet either. Any ideas?

Is it possible to request an uncached file from a server?

My web-server is caching JavaScript files. As a result, it is impossible to debug most of my site. I am unable to turn off caching on the host's settings (business rule). I can confirm that the server caching is the problem because we flushed it and my browser was instantly able to get the newest version of the file. Additionally, FileZilla confirms that my uploads were successful.
Flushing the cache on the browser side has proven ineffective. I am able to edit .php files just fine.
Is it possible for a browser to request an un-cached version of a file?

IIS 8.5 Serving Old Files

I have a clickonce application on Windows Server 2012 IIS 8.5. I recently updated it to a new version and it works fine, except for one url used by a second web page to link to it. It links directly to the .application file and when I use that link I get version 2.1.0.10 of that file instead of the one that is one the server version 3.1.0.1.
It's only when using the that link, other url's server the correct file. I've even stopped the website on both servers (load balanced) and the link still somehow downloads the old file.
I have cache and kernel cache turned off under Output Cache Settings in IIS, I have Common HTTP Response Headers set to Expire Web Content immediately, but it's still serving up and old file even though it doesn't exist anymore. I have a url rewrite rule for that specific url to redirect to one that works and still I download an old file.
I've restarted IIS and the servers themselves and nothing has changed. I then tried copying the files to a new folder and creating a new site in IIS. I copied over the bindings and stopped the old site and app pool. Still get served the old file.
Can anyone help me figure out what's going on with the IIS? How is it serving up a file that doesn't exist, even when the website is stopped? How can I get it to update?
I had the same issue and tried everything mentioned here (and elsewhere!), and finally found out that the reason was the IIS Compression cache!
On the IIS console, click on the website and then on the Compression, and uncheck the Enable static content compression.
This should solve the problem.
If the web server has been stopped, it is possible that this file may be 'served' from your browser's cache.
Have you tried clearing your browser's cache? If this doesn't work, it might be worth restarting the IIS service completely, or, failing that, moving the website's wwwroot directory elsewhere, and redeploying the latest version of your site, or simply renaming the .application file and re-deploying?
This would be akin to cleaning and re-building a project in Visual Studio.
This was eventually found to be caused by a setting on the load balancer caching results. We turned off this setting and now no longer have the issue.

CSS, Scripts changes not reflect after published in IIS

We have hosted our site that use Mvc application in IIS. We are frequently making some design changes in CSS and Scripts files. So frequently publishing the changes in IIS.
But in client side CSS and Scripts changes are not reflected since its coming form cache. It makes our clinet to hard refresh to get the updated changes.
Is there any way we can do in IIS or hosting machine while publishing, that force to client browser to reload the CSS and Scripts.
Like cleaning the temporary files in IIS or any other way.
Regards,
Karthik.

Precompiled .NET app receiving "Internet Explorer cannot display the webpage"

We have a web server that is running many web applications. When I took over this server, I noticed that the sites were not precompiled, so in an effort to clean it up, I precompiled the site using the Publish option in VS2008 (and allow the precompiled site to be updatable).
When I deployed the site to the web server, the site stopped working - In IE, I get "Internet Explorer cannot display the webpage" - in firefox I get "Unable to connect. Firefox can't establish a connection to the server at >>sub.domain.com<<". Here are a few things I've noticed:
I am able to manually browse to the one static .html file that is part of the site
If I replace the precompiled files on the server with uncompiled code, the site works fine
If I switch the application pool to use .NET 4.0, I get errors with duplicate system.web.extensions module, which I would expect to see with an application built for .NET 3.5.
When I initially browse to the site after a fresh IISRESET, the app redirects to /Login.aspx, which the web.config defines as the forms auth login page. It then redirects to /default.aspx and displays the error in question.
CustomErrors is OFF, debugging is ENABLED, and yet I don't get a helpful .NET error page, and I see no System or Application-level events in the Windows event log.
Any hints as to why this might be happening? I was able to successfully precompile another site on the same server with ZERO problems.
I found the problem myself. The login page was redirecting to HTTPS if the host header wasn't localhost. I noticed that in the uncompiled site, someone manually went into the .VB file for the login page and added the specific domain for the beta site into this check, preventing the redirect to HTTPS. I copied the code into my local, recompiled, and deployed, and now the site works as expected.

Resources