Updates yepnope cache in jsinit.cs to append correct rnd value
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18408
|
||||
// Runtime Version:4.0.30319.18444
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -89,6 +89,7 @@ namespace Umbraco.Web.UI.JavaScript {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to yepnope.addFilter(function (resourceObj) {
|
||||
/// var url = resourceObj.url;
|
||||
/// var rnd = ##rnd##;
|
||||
/// var _op = "?";
|
||||
/// if(url.indexOf("lib/") === 0 || url.indexOf("js/umbraco.") === 0){
|
||||
/// return resourceObj;
|
||||
@@ -97,7 +98,7 @@ namespace Umbraco.Web.UI.JavaScript {
|
||||
/// _op = "&";
|
||||
/// }
|
||||
///
|
||||
/// resourceObj.url = resourceObj.url + _op + "umb__rnd=" + (new Date).getTime();
|
||||
/// resourceObj.url = resourceObj.url + _op + "umb__rnd=" + rnd;
|
||||
/// return resourceObj;
|
||||
///});.
|
||||
/// </summary>
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
<data name="JsNoCache" xml:space="preserve">
|
||||
<value>yepnope.addFilter(function (resourceObj) {
|
||||
var url = resourceObj.url;
|
||||
var rnd = ##rnd##;
|
||||
var _op = "?";
|
||||
if(url.indexOf("lib/") === 0 || url.indexOf("js/umbraco.") === 0){
|
||||
return resourceObj;
|
||||
@@ -132,7 +133,7 @@
|
||||
_op = "&";
|
||||
}
|
||||
|
||||
resourceObj.url = resourceObj.url + _op + "umb__rnd=" + (new Date).getTime();
|
||||
resourceObj.url = resourceObj.url + _op + "umb__rnd=" + rnd;
|
||||
return resourceObj;
|
||||
});</value>
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user