Updates yepnope cache in jsinit.cs to append correct rnd value

This commit is contained in:
perploug
2014-02-19 00:15:22 +01:00
parent 81305173ca
commit 7ed11c04c5
4 changed files with 19 additions and 10 deletions

View File

@@ -41,13 +41,21 @@ namespace Umbraco.Web.UI.JavaScript
public string GetJavascriptInitialization(HttpContextBase httpContext, JArray umbracoInit, JArray additionalJsFiles = null)
{
var result = GetJavascriptInitializationArray(httpContext, umbracoInit, additionalJsFiles);
var noCache = string.Empty;
//if debugging, add timestamp, if in production CDF will append CDF version (and should also append umb version)
var noCache = Resources.JsNoCache;
//if debugging, add timestamp, if in production we tell yepNope to append umb+cdf version
//this is needed even tho cdf does this on its serverside merged js
//as assetsService.load() also need to append these versions to ensure cache bursting on updates + pack installs
if (httpContext.IsDebuggingEnabled)
noCache = Resources.JsNoCache;
noCache = noCache.Replace("##rnd##", "(new Date).getTime()");
else
{
var version = "'" + Umbraco.Core.Configuration.UmbracoVersion.Current.ToString() + "." + ClientDependency.Core.Config.ClientDependencySettings.Instance.Version + "'";
noCache = noCache.Replace("##rnd##", version);
}
return ParseMain(
noCache,
result.ToString(),