ScriptRegistrar, compress

2 posts, 0 answers
  1. Krzysztof Wiśniewski
    Krzysztof Wiśniewski avatar
    1 posts
    Member since:
    Mar 2010

    Posted 02 Jun 2012 Link to this post

    Hosting service, I use it, can works only in medium trust mode and I can't to set some parameters like compressing. Up to day I use in Telerik MVC applications code looks like this:
        @(Html.Telerik().ScriptRegistrar()
            .Globalization(true)
            .DefaultGroup(group => group
                .Add("~/Scripts/modernizr-1.7.min.js")
                .Add("~/Scripts/jquery-1.7.1.min.js")
                .Add("~/Scripts/jquery.min.js")
                .Combined(true)
                .Compress(true)
                .CacheDurationInDays(14)
            )

    and
        @(Html.Telerik()
            .StyleSheetRegistrar()
            .DefaultGroup(group => group
                .Add("telerik.common.css")
                .Add("telerik.windows7.css")
                .Add("Site.css")
                .Combined(true)
                .Compress(true)
                .CacheDurationInDays(14)
            )
        )
    Everythink works fine and typical page speed measured by google pagespeed tools was not less than 85 points with/without CDN.
    Now, I would like to use similar code in Kendo UI MVC based programs. How to do it? Testing code used Telerik Kendo UI MVC without compressing gives me not satisfied result equal 54 points :(

    Krzysztof
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 04 Jun 2012 Link to this post

    Hi, 

    You have the following options:
    1. Enable compression in your web server. This is the recommended approach. Here is a blog post showing how to do this: http://blogs.msdn.com/b/vivekkum/archive/2009/02/18/http-compression-in-iis-6-and-iis-7-using-service-account.aspx 
    2. Use the bundling support of ASP.NET 4.5: http://weblogs.asp.net/scottgu/archive/2011/11/27/new-bundling-and-minification-support-asp-net-4-5-series.aspx 
    3. Continue to use the ScriptRegistrar and StyleSheetRegistrar

    Regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top