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

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?

Related

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

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.

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.

How to switch off Akamai caching for dynamic html files?

I run wordpress site and am using Akamai for caching. I have a link on every page so the user can switch between desktop and mobile site at any point. This link once clicked stores cookie which is passed to server with every request and so server knows if needs to return mobile site or desktop version.
Now when I access via "origin" it all works fine as it skips Akamai caching. However when accessing site as normal, so with Akamai caching, the link doesn't do anything. I'm assuming its because as far as Akamai is concerned its exactly the same url request and as Akamai has already its cached version it returns the same page ignoring the cookie all together.
Is there any way to tell akamai directly from my php files in wordpress not to cache html and do it only for images,css etc?
Or maybe is there a setting in Akamai itself where this can be specified?
If not then what other options would I have to get this working?
Yes there are a number of ways to do this. The easiest way would be to do a no cache on specific file extensions such as .html
You can tweak the files to be or not to be cached in AKAMAI through "Configuration Attributes and Digital Properties" screen.
On "Time To Live Rules", you can define path and their caching policy.
Apart from that if you want to validate if a particular web resource id rendered from AKAMAI or not, you can use Fiddler and a particular PRAGMA header.
Refer link Validate if web resource is served from AKAMAI (CDN)?? for more details.

Not able to delete a file because of IIS

What is the functionality
This web application allows user to upload to web-server, download and delete files uploaded on web-server.
Problem
After downloading a file, when user tries to delete it, an exception is thrown saying this file is being used by another process.
What can be done after download is complete so that IIS releases any lock on the file?
Are you using Server.TransferFile to serve the file from the server? Or you might have something setup in your handlers that causes a similar method to send the files.. The only thing I've seen to unlock the file is to reset IIS :-/
Instead of letting IIS serve the file if you let asp.net send it back in the Response stream then you shouldn't get a problem with the file being locked
also make sure you're disposing of any STream readers that are accessing the files..
If that doesn't help then please post code :-)

How to configure web.config to support file handler

I created a file browser control which open files on client machine itself, so I don't need to bother about file path
from my application I am not able to redirect page to
file:///C:/Program%20Files/Application/readme.txt
it works for
http://
how can I configure my application to support file handler.
Thanx
If you are trying to redirect to a local file. This is not possible without knowing quite a lot of information on the client machine - for example how do you know the directory structure of the client computer?
Response.Redirect tells the client (browser) where to redirect to. A file URL will be one that is on the client machine - you would need to know in advance that the file is there, that the user has permissions to view it etc...
Are you asking how to send a file from the server?
You can do this via Response.WriteFile.

Resources