10

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?

Chris
  • 320
  • 3
  • 14

3 Answers3

12

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.

Aidin Tavakkol
  • 239
  • 2
  • 5
1

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.

XtraSimplicity
  • 5,704
  • 1
  • 28
  • 28
  • 1
    I tried restarting IIS and the server itself, and also copied the site to a new directory and created a new IIS site and copied over the bindings. Still get served the old file that doesn't exist. Also cleared my browser cache. – Chris Apr 17 '16 at 03:32
  • Do you (or your employer) have a proxy between you and the server which could also be acting as a cache? As a test, could you make a backup of your ``.application`` file and create a new text file, add some random text, and then rename it so that it has the same name as the previous ``.application`` file? If there is in fact no caching, accessing the ``.application`` file via your web browser shouldn't yield the same result as before. – XtraSimplicity Apr 17 '16 at 03:53
  • I didn't change it to a text file, but putting the url my browser also gave me the old file that didn't exist anymore. I actually had never used this url before (it was not a fully qualified domain name and pointed directly to the .application file), so I'm not sure my personal cache would be the issue. I'm checking with the load balancer now. – Chris Apr 18 '16 at 13:14
  • I had the load balancer turn off the caching and that seemed to have the link change. Our load balancer admin mentioned that the load balancer just uses the cache settings passed in the http headers. I checked under the http response headers in IIS for the site and there was nothing there and 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. Is there anywhere else that might be settings the headers? This is a clickonce application so I'm not really doing any web page coding. – Chris Apr 18 '16 at 20:21
  • 1
    Have you taken a look at HTTP compression? It is possible (albeit possibly unlikely) that the ``.application`` file has been compressed and subsequently cached by IIS. Though, to be honest, if it works _without_ the load balancer, I'd be looking at the load balancer's caching. Try to set all IIS servers to use the same caching configuration, clear the load balancer's cache, and then re-enable caching on the load balancer. With any luck, this will clear any discrepancies between the IIS server and the load balancer, and the symptoms should fade away. Good luck! :) – XtraSimplicity Apr 19 '16 at 10:51
  • Just ran into this same exact issue. Absolutely nothing would clear the cache (restarting IIS, renaming / moving files etc) short of a reboot. However, I fired up Edge (barf) and it pulled the most recent version of the files.. bizarre. – Justin Aug 03 '16 at 17:27
1

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.

Chris
  • 320
  • 3
  • 14