Skip to content

Instantly share code, notes, and snippets.

@MarcStoecker
Created July 12, 2012 21:31
Show Gist options
  • Save MarcStoecker/3101167 to your computer and use it in GitHub Desktop.
Save MarcStoecker/3101167 to your computer and use it in GitHub Desktop.
Rewrite DAMP's (DigibizAdvancedMediaPicker for Umbraco) backend thumbnail requests to use ImageResizer for lightning fast resize and effective disk caching
<system.webServer>
<!-- IIS rewrite module 2.0 -->
<rewrite>
<rules>
<!-- Umbraco backend: merge DAMP with ImageResizer.Net -->
<!-- Rewrite DAMP's (DigibizAdvancedMediaPicker for Umbraco) backend thumbnail requests to use ImageResizer -->
<!-- for lightning fast resize and effective disk caching -->
<rule name="DAMP">
<match url="^umbraco/plugins/DigibizAdvancedMediaPicker/DAMP_ImagePreview\.ashx" />
<conditions trackAllCaptures="true">
<add input="{QUERY_STRING}" pattern="img=(.*?(?=\x26))" />
<add input="{QUERY_STRING}" pattern="w=([0-9]+)" />
<add input="{QUERY_STRING}" pattern="h=([0-9]+)" />
</conditions>
<action type="Rewrite" url="{C:1}?width={C:2}&amp;height={C:3}" redirectType="Found" appendQueryString="false" />
</rule>
</rules>
</rewrite>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment