more on why ie will only let you save as bmp

...and why View->Source sometimes stops working.

I had previously discussed this here.  In that post I mentioned the reason for this was IE's cache was filling up.  This brings up the question, "Why does the cache scavanger not kick in and do its job at that point?" 

To answer, I must first explain a bit about how the Temporary Internet Files folder (TIFF) works.  We have an internal set of APIs that map URLs to blobs of data.  Imagine a hash table.  For caching purposes, the blob of data mapped to the URLs is the cache file name in the TIFF.  So really, and this is the crux of the issue, there are two limits on the cache: the size on disk that the TIFF is limited to, and the number of entries in the index that maps URLs to cache file names.

When the TIFF gets full, the scavager kicks in.  When the table that maps URLs to blobs runs out of entries, the scavanger is not invoked.  Running out of entries is the cause of the problem, because at that point IE cannot map new URLs to the cache filename.  The files are in the cache, the cache is not full, but we cannot find them because the index was full when they were added.    This usually happens when you have lots of small files in the cache.

This is an interesting bug from a software engineering perspective.  The reasons why particular actions are failing are not clear, i.e. you can debug and see that the cache file name was not found, but since it got added at an earlier time you do not know why it is not in the cache.  The cache itself is not full because it has not reached its limits.  This behavior will only be reproducable for some pages, depending on whether they were in the cache before or after it filled up. Furthermore this will bug will only be reproducable on some machines.  The mandelbug nature is probably why this was never fixed before.

So clearing the cache is still the solution to the BMP only/View->Source problem, for now.  This will be fixed in an upcoming release.