]> source.dussan.org Git - archiva.git/commitdiff
append timestamp on js urls if version ends with SNAPSHOT will fix cache for deployed...
authorOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 19:26:40 +0000 (19:26 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 19:26:40 +0000 (19:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1308490 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html

index 2736cd0f75f3aa1c7a8184a89734a247b973e185..588802afedad3e0962f5d70e2944531f747729a7 100644 (file)
     }
 
     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",