From: Olivier Lamy Date: Mon, 2 Apr 2012 19:26:40 +0000 (+0000) Subject: append timestamp on js urls if version ends with SNAPSHOT will fix cache for deployed... X-Git-Tag: archiva-1.4-M3~862 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=949b66bf1a66fafd40b55a20974b465e289b4780;p=archiva.git append timestamp on js urls if version ends with SNAPSHOT will fix cache for deployed SNAPSHOT version, if devMode if activated always add timestamp too git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1308490 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html index 2736cd0f7..588802afe 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html @@ -54,19 +54,24 @@ } timestampNoCache=function(){ - if (!window.archivaDevMode){ - return ""; + if (window.archivaRuntimeInfo.version.match("SNAPSHOT$")=="SNAPSHOT"){ + return "&archivaTimestamp="+window.archivaRuntimeInfo.timestamp+(window.archivaRuntimeInfo.devMode?"&_="+jQuery.now():""); } - return "&_="+jQuery.now(); + return ""; } appendTemplateUrl=function(){ return appendArchivaVersion()+timestampNoCache(); } + appendJsNoCacheUrl=function(){ + return appendArchivaVersion()+timestampNoCache(); + } + $.ajax({ url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/en", dataType: 'json', + cache: false, success:function(data){ window.archivaDevMode=data.devMode; @@ -75,7 +80,7 @@ require.config({ baseUrl: "js/", - urlArgs: ""+appendTemplateUrl(), + urlArgs: ""+appendJsNoCacheUrl(), paths: { "i18n":"jquery.i18n.properties-1.0.9", "jquery": "jquery-1.7.2",