IIS serves stale content when you store the content on a VHD

This article helps you work around the problem where Internet Information Services (IIS) serves stale content when you store the content on a Virtual Hard Drive (VHD).

Original product version:   Internet Information Services 8.0
Original KB number:   2814040

Symptoms

Consider the following scenario.

  • You are hosting a web application on IIS 8.0 or earlier.
  • You stored the content for your web application on a VHD.
  • When you make an update to the content, such as adding a new version of an image file or editing text on a page, you expect that the updated content will be served to incoming web requests.

In this scenario, the updated content is not display, and incoming web requests are responded to with the old content version.

Cause

This behavior occurs because File Change Notifications (FCN) do not traverse across mount points. Since HTTP.sys is not notified that a new version of the content is available, it continues to serve the version of the content it has stored in its kernel-mode cache.

Workaround

To work around this behavior, choose one of the following options:

  • Manually flush the HTTP.sys cache for the web application after making updates to the content stored on the VHD. To flush the HTTP.sys cache for the application, restart the application pool.

  • Do not store your content on a VHD.

Steps to reproduce

  1. Install IIS.
  2. Create new VDisk (for example, C:\VDisk\Disks\DeDup and mount it to C:\inetpub\wwwroot\DeDup).
  3. Copy a PNG file (2.png) to the new VDisk.
  4. Enable DeDup on VDisk.
  5. Optimize VDisk by doing ddpcli enqueue /opt /vol "C:\inetpub\wwwroot\DeDup" (FSUTIL reparsepoint query C:\inetpub\wwwroot\DeDup\2.png shows optimized).
  6. Load http://ServerName/DeDup/2.png.
  7. Edit C:\inetpub\wwwroot\DeDup\2.png and save it.
  8. Load http://ServerName/DeDup/2.png - see the changes.
  9. Optimize VDisk again (FSUTIL reparsepoint query "C:\inetpub\wwwroot\DeDup\2.png" shows optimized).
  10. Load http://ServerName/DeDup/2.png - see the changes.
  11. Edit C:\inetpub\wwwroot\DeDup\2.png again and save it.
  12. FSUTIL reparsepoint query C:\inetpub\wwwroot\DeDup\2.png shows not optimized.
  13. Load http://ServerName/DeDup/2.png - don't see the newest changes!
  14. Open file directly on content server to make sure the file contains both sets of changes - it does.

More information