Conflict between Iirf & HttpModule

Topics: Developer Forum
May 5, 2010 at 9:37 PM

I have an HttpModule that does dynamic image resizing on an http request, so I can make a request like:

And it will take the original image, resize it to width 300, cache it in a location on the server, then does a context.RewritePath to point the request to the resized image. When Iirf is enabled, rewriting works fine, but the image resizer does not. I have a feeling that the request is bypassing the module because of Iirf.

Has anyone run into anything like this before? Is there a way I can get Iirf to ignore images, or otherwise pass the request on to my module? I could even modify the module if I need to.


May 6, 2010 at 12:19 AM
Edited May 6, 2010 at 12:20 AM

Hard to say, but it could be very simple.

It could be that you can get IIRF to ignore the requests that need to be resized, using a particular test pattern.

It doesn't really matter what the URL Image resizer does, I think.  The question is, do you want IIRF to rewrite the request, or not?   If you want IIRF to NOT rewrite a set of requests, then write a pattern that excludes those URLs from rewriting.

When you say " have a feeling that the request is bypassing the module because of Iirf." ... there's no reason to resort to feelings. With the IIRF log, you will be able to see whether IIRF is rewriting requests for images, very clearly.  No need to guess.  If so, then introduce a new rule to prevent that.  The - replacement pattern combined with the [L] flag will do that:

RewriteRule ^/(.*).jpg??width=([0-9]+)$  - [L]  

 of course, your pattern will probably be different, but that's a good start.