Question

I need some help with Rejuicer. I just inherited a C# webapplication that uses it and I cannot figure out what exactly is going on.

in the global.asmx.cs under Application_Start we are

OnRequest.ForJs("~/Combined-{0}.js") .Combine .FilesIn("~/js-survey/") .Matching("*.js") .Configure();

I believe this is combining all the *.js in the js-survey/ folder into a single js called Combined-Uniquename.js. Is this combining the file on the server?

Then in the Master Page it is using "<%# Rejuiced.JsFor("~/Combined-{0}.js") %>"

is this retrieving the file from the server?

How can I test these?

s

Was it helpful?

Solution

Is this combining the file on the server?

It is dynamically combining the JavaScript files on app startup and storing them in memory. When a request is done to ~/Combined-HASH.js, Rejuicer handles the request and serves the combined files from memory. This is handled by RejuicerModule.

The {0} is replaced by a hash of the file. It ensures that when any of the files are changed, the cache is invalidated (since the "file name" will be different). Rejuiced.JsFor renders a <script> tag with the correct URL including the hash.

Take a look at the documentation and website (web.archive.org mirror, the site no longer exists) for more information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top