-
Notifications
You must be signed in to change notification settings - Fork 48
How can I get RequestReduce to refresh changed CSS, scripts or images?
RequestReduce will automatically reprocess your css and javascript if any of the css or script urls on a web page change. So if you have a means of versioning your css and script files with a querystring parameter or path string, RequestReduce will pick this up as soon as your change is added to the page. However, if you do not change the file name and make a change to the css or script contents or a change to one of its background images, RequestReduce provides a means to explicitly flush the previously generated css so that it can be reprocessed.
There are two ways to go about this:
-
Flush all RequestReduce generated css and javascript, forcing RequestReduce to reprocess all css and scripts on your site:
GET: http://<your host>/<RequestReduce virtual path>/flush
Unless you have explicitly configured a RequestReduce virtual path, the path is /RequestReduceContent.
-
Flush only the css or scripts included in a single "CSS or javascript Signature":
GET: http://<your host>/<RequestReduce virtual path>/<signature>-flush
RequestReduce considers the aggregate of all css urls in a single head tag or all script urls in a single adjoined set to be a CSS or javascript signature. Many small to medium sites may have the same signature on each page. The actual signature string can be located in the files that RequestReduce generates:
/RequesteduceFiles/f5623565740657421d875131b8f5ce3a-ee5b55aecc47faadc5807c65ab4bdd1f-RequestReducedStyle.css
The CSS or javascript signature here is the string just after the last slash and before the first dash: f5623565740657421d875131b8f5ce3a.
You can also use the RequestReduce dashboard page at http://<your host>/<RequestReduce virtual path>/dashboard
to find specific flush links for processed javascript and css signatures.
##Limiting access to flush urls to authorized users It may be undesirable to allow anyone the ability to flush RequestReduce processed css and scripts. If someone were to repeatedly flush your content, RequestReduce might repeatedly reprocess your content which is an expensive operation and negatively impact the CPU utilization of your web servers.
By default, anyone can invoke these urls. However you can add an authorizedUserList property to your RequestReduce Configuration Options containing a comma delimited list of user names allowed to invoke the flush urls. RequestReduce expects one of the user names to be in:
HttpContext.User.Identity.Name
You can also limit by IP address using the ipFilter setting.