title: How does NuGet decide whether to use local package cache or not?
body: <p>Today I've faced with a strange behavior of NuGet when installing a package.</p>
  
  <p>A brief description: as a result of my build script there's a NuGet package. I don't change the version each time, so each and every build produces <code>MyPackage.1.0.0.nupkg</code>. As the final step of the build, I push the package to the NuGet server deployed inside the local network.</p>
  
  <p>Now, on a different machine, I run <code>nuget install MyPackage -Source http://myserver/nuget</code>, which obviously installs the NuGet package.</p>
  
  <p>The problem comes into play when I push another update of <code>MyPackage</code> - still of version <code>1.0.0</code>. When I try to re-install it on client machine, I get the previous version of the package.</p>
  
  <p>I found out <a href="http://nuget.codeplex.com/wikipage?title=Machine%20Level%20Cache%20Part%201" rel="noreferrer">it is the local cache to be blamed</a>: if the package was installed, it gets into the local cache and the next time the package <strong>of the same version</strong> is installed, it is taken from cache. Fair enough!</p>
  
  <p>But, on the other hand, there's a <code>-NoCache</code> option of the <code>nuget install</code> command, and I expect it to ignore the local cache. </p>
  
  <p>However, this is not true. The first time I run it with <code>-NoCache</code>, it updates the cache and installs the true latest version. But, the next time the package is still taken from cache, even with <code>-NoCache</code> option.</p>
  
  <p>Is it expected? Is it because of the version not being changed? </p>
  
  <p>Just in case: all NuGet operations are done with <code>NuGet.exe</code> and from PowerShell session.</p>
  
  <p><strong>UPDATE</strong>: I observe strange behavior I can only explain by cache expiration. When the package is cached, all subsequent calls to <code>nuget install</code> pull the package from cache, <strong>until some time passes</strong>. I didn't notice the exact period, but it's definitely more than an hour. After this, <code>nuget install</code> updates the package in the cache, and the situation becomes the same...</p>