According to Telerik:
To distribute your web asset group via content delivery network you should use the ContentDeliveryNetworkUrl() method:
<%= Html.Telerik().ScriptRegistrar().Scripts(scripts =>
scripts.AddGroup("CommonScript", group =>
group.Add("~/Scripts/Core.js")
.Add("~/Scripts/Stuff.js")
.Combined(true)
.CacheDurationInDays(365)
.Compress(true)
.ContentDeliveryNetworkUrl("http://mycdn.com/CommonScript.js")
)
I'm confused by this, specifically:
ContentDeliveryNetworkUrl("http://mycdn.com/CommonScript.js")
How does this file get created on the CDN? I assume Core.js and Stuff.js get combin开发者_如何学运维ed, cached, and compressed then uploaded to my CDN automatically? Or is CommonScript.js another JS file that get's added to the combined script? If so, then the combined script gets served locally still, and not from the CDN?
Telerik say VERY VERY little about how all this work.
Any help is greatly appreciated.
- Matt
You need to upload the combined file by yourself. The ContentDeliveryNetworkUrl just tells the script registrar to output that value instead of core.js and stuff.js.
精彩评论