1

I've recently implemented RequestReduce on a site we have in development.

It's working well except for one behavior that's proving problematic. I noticed that ReduceRequest rewrites the paths of background images, for example, to be a full path instead of relative. This is a problem for this application because it contains a css style (from a common, shared site and style sheet, via a virtual directory) that contains an .htc file fix for IE pngs. (I know, I know, don't ask me why we still do this).

When RequestReduce re-writes the style, the style becomes

img.pngfix,div.pngfix img{behavior:url(http://[domain]/_common/htc/iepngfix.htc)}

(_common is a virtual directory to our common includes site)

This throws a permission denied error in IE as you can't use htc from an external domain the way I understand it (it does function as expected without the domain).

enter image description here

So I've been trying to come up with a way to have RequestReduce not re-write the CSS rules to add domain. Parsing through the documentation I came across this:

https://github.com/mwrock/RequestReduce/wiki/The-RequestReduce-Api (specifically, the section labelled Transforming the URLs generated by RequestReduce)

The API seems to indicate this can be done with something like the following:

RequestReduce.Api.Registry.UrlTransformer =
                    (context, x, y) =>
                    y.Replace("[http://domain]", "");

But so far, I've never seen this work. It never actually replaces the domain portion with nothing as I'm requesting.

I've also posted on this bug thread which seems to indicate that there is an issue with this functionality: https://github.com/mwrock/RequestReduce/issues/177

Does anyone have any experience with ReduceRequest and URL transformations? I'm hoping to verify I'm not doing anything improperly as I'm pretty new to the tool. This tool would be a definite win for our applications so I'm hoping to be able to work around this.

Thanks for any help you can offer.

4

0 回答 0