UseCdn and DebugMode

Topics: Customizing Orchard, Writing themes
Apr 5, 2011 at 10:26 PM

Is there any documentation on these two Script.Require() methods?

Is Layout.cshtml the best place to set these to change the behavior of any named script?  An issue with doing that is that it will force those scripts to be included on every page, but the alternative of adding UseCdn() to each script.requires isn't great either.

Orchard.jquery could be improved by adding a CDN definition for jQuery.

Also, why is there is no UI setting for the default value of UseCdn but there is for DebugMode?  Seems like once a site has been developed someone might want to turn off debug mode (dashboard) and turn on CDN mode.

 

Coordinator
Apr 5, 2011 at 10:33 PM

Sure, it could. The explanation for all that is very simple though: lack of time. That would be a great contribution ;)

Apr 12, 2011 at 9:42 PM

For anyone looking to fix this themselves in the jQuery module:

 

  var manifest = builder.Add();
  manifest.DefineScript("jQuery")
    .SetUrl("jquery-1.5.2.min.js", "jquery-1.5.2.js")
    .SetCdn("http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js", "http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js", false)
    .SetVersion("1.5.2");

 

Feb 18, 2014 at 6:15 PM
bertrandleroy wrote:
Sure, it could. The explanation for all that is very simple though: lack of time. That would be a great contribution ;)
I have done this

https://orchard.codeplex.com/SourceControl/network/forks/PaulDevenney/AddEnableCdnOnSiteSettings/contribution/6252

Hopefully it passes inspection!