diff --git a/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml b/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml index 1f036c8609..f94d02df83 100644 --- a/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml +++ b/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml @@ -2,6 +2,7 @@ @using Umbraco.Core @using ClientDependency.Core @using ClientDependency.Core.Mvc +@using Umbraco.Core.IO @using Umbraco.Web @using Umbraco.Web.Editors @using umbraco @@ -19,8 +20,12 @@ Umbraco - - + + @{ Html.RequiresCss("assets/css/umbraco.css", "Umbraco");} + @{ Html.RequiresCss("tree/treeicons.css", "UmbracoClient");} + @Html.RenderCssHere( + new BasicPath("Umbraco", IOHelper.ResolveUrl(SystemDirectories.Umbraco)), + new BasicPath("UmbracoClient", IOHelper.ResolveUrl(SystemDirectories.UmbracoClient))) @@ -55,7 +60,7 @@ @*And finally we can load in our angular app*@ - + diff --git a/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs b/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs index dd75780968..04fec9184e 100644 --- a/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs +++ b/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs @@ -55,11 +55,8 @@ namespace Umbraco.Web.UI.JavaScript else { //create a unique hash code of the current umb version and the current cdf version - var versionHash = new HashCodeCombiner(); - versionHash.AddCaseInsensitiveString(UmbracoVersion.Current.ToString()); - versionHash.AddCaseInsensitiveString(ClientDependencySettings.Instance.Version.ToString(CultureInfo.InvariantCulture)); - - var version = "'" + versionHash.GetCombinedHashCode() + "'"; + var versionHash = UrlHelperExtensions.GetCacheBustHash(); + var version = "'" + versionHash + "'"; noCache = noCache.Replace("##rnd##", version); } diff --git a/src/Umbraco.Web/UI/JavaScript/JsNoCache.js b/src/Umbraco.Web/UI/JavaScript/JsNoCache.js index 707c716778..9cb7d38dc5 100644 --- a/src/Umbraco.Web/UI/JavaScript/JsNoCache.js +++ b/src/Umbraco.Web/UI/JavaScript/JsNoCache.js @@ -2,7 +2,6 @@ yepnope.addFilter(function (resourceObj) { var url = resourceObj.url.toLowerCase(); var rnd = ##rnd##; var op = "?"; - debugger; if(url.indexOf("lib/") === 0 || url.indexOf("js/umbraco.") === 0 || url.indexOf("dependencyhandler.axd") > 0) { return resourceObj; diff --git a/src/Umbraco.Web/UrlHelperExtensions.cs b/src/Umbraco.Web/UrlHelperExtensions.cs index eb9b47eee1..1893a36c89 100644 --- a/src/Umbraco.Web/UrlHelperExtensions.cs +++ b/src/Umbraco.Web/UrlHelperExtensions.cs @@ -1,10 +1,13 @@ using System; +using System.Globalization; using System.Linq; using System.Linq.Expressions; using System.Management.Instrumentation; using System.Web.Mvc; using System.Web.Routing; +using ClientDependency.Core.Config; using Umbraco.Core; +using Umbraco.Core.Configuration; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi; using Umbraco.Web.WebServices; @@ -150,27 +153,45 @@ namespace Umbraco.Web /// - /// Return the Url for an action with a cache-bursting hash appended + /// Return the Url for an action with a cache-busting hash appended /// /// /// /// /// /// - public static string GetUrlWithTimeStamp(this UrlHelper url, string actionName, string controllerName, RouteValueDictionary routeVals = null) + public static string GetUrlWithCacheBust(this UrlHelper url, string actionName, string controllerName, RouteValueDictionary routeVals = null) { - var applicationJs = url.Action(actionName, controllerName, routeVals); - - //make a hash of umbraco and client dependency version - //in case the user bypasses the installer and just bumps the web.config or clientdep config - var umb_rnd = Umbraco.Core.Configuration.GlobalSettings.CurrentVersion + "_" + ClientDependency.Core.Config.ClientDependencySettings.Instance.Version; - - //if in debug mode, always burst the cache - if (Umbraco.Core.Configuration.GlobalSettings.DebugMode) - umb_rnd += "_" + System.DateTime.Now.Ticks; - - applicationJs = applicationJs + "?umb__rnd=" + umb_rnd; + var applicationJs = url.Action(actionName, controllerName, routeVals); + applicationJs = applicationJs + "?umb__rnd=" + GetCacheBustHash(); return applicationJs; } + + /// + /// + /// + /// + public static string GetCacheBustHash() + { + //make a hash of umbraco and client dependency version + //in case the user bypasses the installer and just bumps the web.config or clientdep config + + var versionHash = new HashCodeCombiner(); + + //if in debug mode, always burst the cache + if (GlobalSettings.DebugMode) + { + versionHash.AddCaseInsensitiveString(DateTime.Now.Ticks.ToString(CultureInfo.InvariantCulture)); + } + else + { + //create a unique hash code of the current umb version and the current cdf version + + versionHash.AddCaseInsensitiveString(UmbracoVersion.Current.ToString()); + versionHash.AddCaseInsensitiveString(ClientDependencySettings.Instance.Version.ToString(CultureInfo.InvariantCulture)); + } + + return versionHash.GetCombinedHashCode(); + } } } \ No newline at end of file