Skip to content

RequestReduce Configuration options

mwrock edited this page Jul 9, 2011 · 21 revisions

RequestReduce provides several configuration properties to customize how RequestReduce behaves. Unconfigured, RequestReduce uses defaults appropriate for a basic single server environment. In order to configure RequestReduce, you must add its configuration section to your web.config's <configSections/>.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="RequestReduce" type="RequestReduce.Configuration.RequestReduceConfigSection, RequestReduce"/>
  </configSections>
</configuration>

With this <section/> element added, you can add the RequestReduce configuration to your config which looks like this:

<RequestReduce spriteVirtualPath="/RRContent" connectionStringName="RRConnection" 
 authorizedUserList="anonymous"/>

The example above is not a complete list of the attributes available to the RequestReduce configuration. The table below lists and describes each option as well as its default setting. Keep in mind that these attributes are case sensitive.

Attribute Description Default
spriteVirtualPath This is the virtual path to the location where RequestReduce saves transformed css and sprite files. If you set this to "/content/ReducedResources" then RequestReduce will save all of its generated files to the directory that maps to this path and create image urls that point to that path. If the physical path does not exist, RequestReduce will create it. /RequestReduceFiles
spritePhysicalPath You should not have to include this option unless you want to save RequestReduce generated files to a physical path that is different from the path that spriteVirtualPath maps to. This can be any valid UNC path either local or remote. Important: The process under which your web site runs must have write privileges to this path. The path that maps to spriteVirtualPath
contentHost This allows you to specify a specific host name used for all RequestReduce urls. You would use this if you employ a CDN or cookieless domain for static content. If you want all your static content to be referenced at http://static.mysite.com, then this attribute would be http://static.mysite.com. Empty
spriteSizeLimit The number of bytes to try and limit the size of generated sprite files. This does not guarantee that the file will not exceed this amount. However, as RequestReduce is adding individual sprite images to a file, once the file's byte count exceeds this threshold, it will save all subsequent images to a new file. 50000
Clone this wiki locally