This is a migrated thread and some comments may be shown as answers.

[Solved] WebAssetDefaultSettings.ScriptFilesPath and Custom CDN

7 Answers 167 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jason
Top achievements
Rank 1
Jason asked on 10 Sep 2010, 09:21 PM
I would like to use our custom CDN and specify something like the following

WebAssetDefaultSettings.ScriptFilesPath = "http://somedomain.com/scripts/"

on the server we would have 

/scripts/2010.2.825/{all telerik js files}

is there any way to accomplish this?  It gives an error when I try to set an 
absolute path, saying it can only take a virtual.

Thanks,
JB

7 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 13 Sep 2010, 09:17 AM
Hello Jason Brozek,

Check this online help article (Content Delivery Network support section) devoted on the same matter.

Regards,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jason
Top achievements
Rank 1
answered on 13 Sep 2010, 02:13 PM
Yes I have read that section, I can see that you can hard code a specific script.  I'm wanting to do this for the telerik js files,
which it seems the ScriptRegistrar builds the list of needed js files based on the controls used in the page, I want
to put them on our custom cdn, and have it still dynamically pull only the scripts that are needed.
Just like how you would say

WebAssetDefaultSettings.UseTelerikContentDeliveryNetwork = true;

I want to define my own cdn, instead of using the telerik cdn.

Thanks,
JB
0
Georgi Krustev
Telerik team
answered on 13 Sep 2010, 05:09 PM
Hi Jason Brozek,

Thank you for the clarification.

Currently this feature is not supported. Nevertheless I will forward this request to our developers for further investigation and consideration.

Sincerely yours,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alex Gyoshev
Telerik team
answered on 15 Sep 2010, 12:54 PM
Hello Jason,

The functionality is already implemented, using the ContentDeliveryNetworkUrl property. Just set the property of the DefaultGroup to your CDN and the automatic loading should start working as you expect it.

<%= Html.Telerik().ScriptRegistrar()
        .DefaultGroup(defaultGroup => defaultGroup
            .ContentDeliveryNetworkUrl("http://mylovelycdn.com/telerik-scripts/")
        )
    %>


For this to work, UseTelerikContentDeliveryNetwork should be set the to true, too.

Best wishes,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Redsquare
Top achievements
Rank 1
answered on 23 Sep 2010, 12:06 PM
Alex,

This does not work, it simply writes out a script tag pointing to the base ContentDeliveryNetworkUrl. it does not iterate the files in the group. Looking at the source code in (from Line 75 in WebAssetitemMerger) if a ContentDeliveryNetworkUrl is set it simply adds the url into the merged list without iterating the group. the else part of this statement does.
0
Alex Gyoshev
Telerik team
answered on 23 Sep 2010, 04:25 PM
Hello again,

I was wrong. ContentDeliveryNetworkUrl sets a URL from which the group is loaded. You can, however, set the default CDN URL by editing the WebAssetDefaultSettings class.

I am sorry for misguiding you - and I hope this helps.

Best wishes,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
nachid
Top achievements
Rank 1
answered on 24 Oct 2010, 12:08 PM
Can we have this possibility added to the next release
Me too, I am interested to put my static content in a different CDN
Ideally, can we have something like 
WebAssetDefaultSettings.ScriptContentDeliveryNetworkUrl =...
WebAssetDefaultSettings.StyleContentDeliveryNetworkUrl  =...


WebAssetDefaultSettings.ContentDeliveryNetworkUrl = @"http://www.sharemeal.com/Assets/Scripts";
            WebAssetDefaultSettings.StyleSheetFilesPath = @"~/Assets/Sheets";
WebAssetDefaultSettings.ContentDeliveryNetworkUrl = @"http://www.sharemeal.com/Assets/Scripts";
            WebAssetDefaultSettings.StyleSheetFilesPath = @"~/Assets/Sheets";
WebAssetDefaultSettings.ContentDeliveryNetworkUrl = @"http://www.sharemeal.com/Assets/Scripts";
            WebAssetDefaultSettings.StyleSheetFilesPath = @"~/Assets/Sheets";
WebAssetDefaultSettings.ScriptContentDeliveryNetworkUrl
            WebAssetDefaultSettings.StyleContentDeliveryNetworkUrl
Tags
General Discussions
Asked by
Jason
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Jason
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Redsquare
Top achievements
Rank 1
nachid
Top achievements
Rank 1
Share this question
or