1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Sitefinity Performance: Script Combining

Sitefinity Performance: Script Combining

4 posts, 0 answered
  1. Jacques
    Jacques avatar
    427 posts
    Registered:
    28 Jun 2007
    08 Jul 2009
    Link to this post
    With the use of Master Pages as templates, is it possible to use script combining?

    According to references on the web, script combining is achieved by replacing <asp:ScriptManager ... /> with <ajaxToolkit:ToolkitScriptManager ... />

    Then one would add the individual axd files that should be combined to the list in the script tags.

    In tests this proves to reduce the number of requests to the server.

    My concern is would this work in Sitefinity templates? And,
    How would one know which scripts need to be combined before hand since the master page serves many pages?

    Regards,
    Jacques
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    14 Jul 2009
    Link to this post
    Hi J.Hov,

    Script combining is possible. The Microsoft Script Manager should be replaced with RadScriptManager rather than ajaxToolkit:ToolkitScriptManager. You need to add a handler in the web.config file - please take a look at RadScriptManager overview. There is a property you need to enable as well - EnableScriptsCombine.

    Kind regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Jacques
    Jacques avatar
    427 posts
    Registered:
    28 Jun 2007
    14 Jul 2009
    Link to this post
    Hi Georgi,

    Thanks for the answer we did manage to prove the case using the Script Manager, but it's interesting that you mentioned using the RadScriptManager.

    One question I have about this is as follows:
    With script combining I'm assuming that Asp.net is putting together the required scripts into one batch, which is then cached on the client side. What I'm failing to see is how combining scripts in this way is beneficial across the site as a hole, especially when used in Master pages and situations like Sitefinity. Fewer requests yes, but consider the following:
    1. The home page of our Sitefinity site uses Home.Master which combines X scripts into one
    2. The about us page uses TwoColumn.Master, but also includes the use of a different control that might require an extra script resource.

    In this scenario, the home page would have combined and loaded say 5 script files into one, but the About Us page needed only one extra script resource. What this effectively means is that the browser would have to reload the entire combined script file again, because in effect it's definition has now changed, or the cached version no longer applies. So Asp.net would have to re-combine all these files again into one bigger file and download a new script file to the browser.

    Is my understanding of this correct?

    Regards,
    Jacques
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    15 Jul 2009
    Link to this post
    Hello J.Hov,

    Please take a look at the following Blog post - Optimization Tips:The Rad Managers for ASP.NET AJAX for full explanations about the script manager.
    Basically you are right - for more pages with different scripts, sometimes you should leave the combining away.

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered