IEInternals

A look at Internet Explorer from the inside out. @EricLaw left Microsoft in 2012, but was named an IE MVP in '13 & an IE userAgent (http://useragents.ie) in '14

What is msimgsiz.dat?

What is msimgsiz.dat?

  • Comments 1

Inside your Temporary Internet Files folder you likely have a file named msimgsiz.dat. If you open this file, you’ll find that it contains nothing but binary goo:

EditPadPro Hex View of msimgsiz.dat

Over the years, many people have asked or speculated about what this file is used for, and the answer is actually quite simple.

This file, used by MSHTML, is simply a lightweight cache of image dimensions (width and height).

Why does Internet Explorer bother caching this data?

For performance reasons, the layout engine can often perform faster if it knows the width and height of a given image; many layout calculations depend on the sizes of embedded objects. An IMG tag that does not specify width and height attributes must be sized according to the intrinsic dimensions of the image file it displays. However, to determine these dimensions, the browser must actually load and parse the image, and doing that might even require a network request. Hence, determining the dimensions of an image may take a fair amount of time in this performance-critical codepath.

To mitigate that bottleneck, this memory-mapped file simply maintains a cache of image URLs to image dimensions for images that have been previously decoded by MSHTML. If the cached values are incorrect (e.g. because the image has been changed, or there was a hash collision) it’s not a problem; when the new/correct size is discovered, the image’s size is adjusted quickly and another layout occurs.

-Eric

  • Is there a way to clear out old data from the file when it gets too big? Can you delete it?

    EricLaw: As far as I recall, there's a size cap beyond which this file will not grow. You can delete this file without causing any problems.

Page 1 of 1 (1 items)
Leave a Comment
  • Please add 2 and 6 and type the answer here:
  • Post