IIS doubles image size when using original file extension
We have configured IIS to use original file extensions (.jpg, .gif, etc) - we have configured ISAPI application mappings so that our Google box can search images from the Media Library (so it doesn’t use the .ashx file extension).
Images that are being accessed from the file system directly (for example, www.site.com/images/img.gif) have appeared to have a size double than its original size. This is a problem for us as pages are required to be kept to a certain size.
The file opened in a browser using the original media extension are being served twice.
Along with mapping the file extensions, a change had to be made to the FilterUrlExtensions section Web.Config:
<processor type="Sitecore.Pipelines.HttpRequest.FilterUrlExtensions, Sitecore.Kernel">
<param desc="Allowed extensions (comma separated)">aspx</param>
<param desc="Blocked extensions (comma separated)">*</param>
<param desc="Blocked extensions that stream files (comma separated)">doc,dot,rtf,docx,pdf,txt,xls,xlsx,csv,mpp,msg,xml,jpg,jpeg,png,gif,bmp,tif,.. etc</param>
<param desc="Blocked extensions that do not stream files (comma separated)">*</param>
</processor>
This change above was so that we can actually view the images that are being accessed from the file system directly, this does not affect images that are accessed from the Media Library - these are fine.
However, this is causing the images to double in size - which we don’t want, but we still require the mapping.
We modified the FileUrlExtensions section in Web.Config yet again to the following:
<processor type="Sitecore.Pipelines.HttpRequest.FilterUrlExtensions, Sitecore.Kernel">
<param desc="Allowed extensions (comma separated)">aspx</param>
<param desc="Blocked extensions (comma separated)">*</param>
<param desc="Blocked extensions that stream files (comma separated)">*</param>
<param desc="Blocked extensions that do not stream files (comma separated)">*</param>
</processor>
We replaced the extensions with a *. In Windows XP - this works fine, the images are being kept at their original size AND we can view the image in the first place.
In Windows Server 2003 however, this unfortunately does not allow us to view the images. But by having the list of file extensions in the <param desc=”Blocked extensions that stream files (comma separated)”></param> section seemed to fix it.
We are hoping someone may have a possible solution for this! It would be very appreciated.