-
Notifications
You must be signed in to change notification settings - Fork 48
How can I disable RequestReduce?
RequestReduce can be disabled in whole or in part for an individual request or accross the entire page. Here are your options:
To completely shut off RequestReduce, simply remove the RequestReduce module from your web.config or remove it from the IIS management GUI.
If you want to disable the filter but keep RequestReduce installed, you can set the cssProcesingDisabled and javascriptProcessingDisabled configuration attributes to true. This will effectively stop RequestReduce from filtering your responses but it will still be able to serve requests for RequestReduce processed content.
If you simply want to disable or suppress the filter from an individual request, you can append RRFilter=disabled to the request's querystring. If RequestReduce sees this key value pair in the url, it will not attach the response filter and the responce will contain the original raw response without RequestReduce's css, javascript and sprites.
You can use the AddFilter method of the RequestReduce Registry to add a PageFilter that defines under what conditions RequestReduce should be suppressed.
Here is an example of how to disable RequestReduce for any Request under /admin/:
RequestReduce.Api.Registry.AddFilter(new PageFilter(x => x.HttpRequest.RawUrl.Contains("/admin/")));
The RequestReduce API passes the PageFilter the current HttpRequest and you can access any of its properties or use your own internal business logic to decide if RequestReduce should be suppressed. If you return true from this lambda, the request matching the criteria of the lambda will not have the RequestRedce filter applied.
See The RequestReduce API for details on its use.