August 20 2008

Solution! IIS Doubles image size when using original file extension

Thanks to the support guys at Sitecore we were able to solve this problem with images accessed from the file system.

The solution was a change to the Web.Config file.  The ISAPI extension mapping settings have remained unchanged, however for Windows 2003 Server there is an extra step which is adding the StaticFileHandler HttpHandler to the Web.Config file.

For Windows XP:
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)">
</param>
<param desc="Blocked extensions that do not stream files (comma separated)">*</param>
</processor>

For Windows 2003 Server:
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)">
</param>
<param desc="Blocked extensions that do not stream files (comma separated)">*</param>
</processor>

Extra step for Windows 2003 Server - add StaticFileHandler HttpHandler:

<httpHandlers>
<add verb="GET,HEAD" path="*.jpg,*.txt,*.gif" type="System.Web.StaticFileHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
..
</httpHandlers>

In the path attribute we have included ALL file extensions we wish to store in Sitecore.

And now the document size of pages have decreased by almost half :)

blog comments powered by Disqus

About



Krystle's blurbs on beginner experiences with Sitecore CMS and the odd random stuff.
Age: 24. Location: Wellington, New Zealand

following

  • Armand was here
  • Saidcore (Sitecore)