Optimizing Gadget Resource Loading

By default, all files included in the gadget XML are fetched through shindig concat requests. The concat request creates a single GET request that concatenates multiple source files and fetches them as a single request after pre-processing them.

However, this method of fetching gadget source file is inefficient when performed on common desktop provided files such as finesse.js or jquery.min.js, which are used across the Finesse Desktop and all other gadgets. This approach bypasses the automatic browser provided caching and therefore increases the desktop load time by increasing the number of requests and bandwidth consumed.

Therefore all desktop provided files should be excluded from the shindig concat based loading, by adding them to the Exclude URL list as shown below:

Procedure


Step 1

Add the optional feature "content-rewrite" to disable the CSS rewrite:

Code Snippet
Copy<Optional feature="content-rewrite">
	<Param name="exclude-url">finesse.js</Param>
       <Param name="exclude-url">jquery.min.js</Param>
	<Param name="exclude-url">finextcommonstyles.css</Param>
 </Optional>

Step 2

In the script tag, link the finesse.js and jquery.min.js files and use the link tag to reference the finextcommonstyles.css file directly from the server using:

<script type="text/javascript" src="__UP_externalServerHost__/desktop/assets/js/finesse.js"></script>

<script type="text/javascript" src="__UP_externalServerHost__/desktop/assets/js/jquery.min.js"></script>

<link rel="stylesheet" type="text/css" href="__UP_externalServerHost__/desktop/scripts/css/finextcommonstyles.css"/>