diff --git a/lib/galaxy/webapps/galaxy/buildapp.py b/lib/galaxy/webapps/galaxy/buildapp.py index 9c3de5c5adf..8a4baa1af69 100644 --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -2,10 +2,11 @@ Provides factory methods to assemble the Galaxy web application """ -import sys +import atexit +import time import os import os.path -import atexit +import sys from paste import httpexceptions import pkg_resources @@ -114,6 +115,8 @@ def app_factory( global_conf, **kwargs ): except: pass + app.server_starttime = int(time.time()) # used for cachebusting + if not app.config.is_uwsgi: postfork_setup() diff --git a/templates/base.mako b/templates/base.mako index acef7faaec1..60b43a0fef0 100644 --- a/templates/base.mako +++ b/templates/base.mako @@ -79,7 +79,8 @@ shim: { "libs/underscore": { exports: "_" }, "libs/backbone/backbone": { exports: "Backbone" } - } + }, + urlArgs: 'v=${int(app.server_starttime)}' }); diff --git a/templates/base/base_panels.mako b/templates/base/base_panels.mako index 0da5a164fd6..9480968c028 100644 --- a/templates/base/base_panels.mako +++ b/templates/base/base_panels.mako @@ -89,7 +89,8 @@ shim: { "libs/underscore": { exports: "_" }, "libs/backbone/backbone": { exports: "Backbone" } - } + }, + urlArgs: 'v=${int(app.server_starttime)}' }); diff --git a/templates/webapps/galaxy/dataset/display.mako b/templates/webapps/galaxy/dataset/display.mako index 1d970f789b5..f1d062769b0 100644 --- a/templates/webapps/galaxy/dataset/display.mako +++ b/templates/webapps/galaxy/dataset/display.mako @@ -13,7 +13,8 @@ baseUrl: "${h.url_for('/static/scripts')}", shim: { "libs/backbone/backbone": { exports: "Backbone" }, - } + }, + urlArgs: 'v=${int(app.server_starttime)}' }); require(['mvc/data'], function(data) { diff --git a/templates/webapps/galaxy/dataset/tabular_chunked.mako b/templates/webapps/galaxy/dataset/tabular_chunked.mako index e48126ba051..66d35c00a2a 100644 --- a/templates/webapps/galaxy/dataset/tabular_chunked.mako +++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako @@ -12,7 +12,8 @@ baseUrl: "${h.url_for('/static/scripts')}", shim: { "libs/backbone/backbone": { exports: "Backbone" }, - } + }, + urlArgs: 'v=${int(app.server_starttime)}' }); require([ 'mvc/data' ], function( data ) { diff --git a/templates/webapps/galaxy/galaxy.panels.mako b/templates/webapps/galaxy/galaxy.panels.mako index cfbedf8bc92..a39b2c059fe 100644 --- a/templates/webapps/galaxy/galaxy.panels.mako +++ b/templates/webapps/galaxy/galaxy.panels.mako @@ -97,7 +97,8 @@ "libs/underscore": { exports: "_" }, "libs/d3": { exports: "d3" }, "libs/backbone/backbone": { exports: "Backbone" }, - } + }, + urlArgs: 'v=${int(app.server_starttime)}' }); var galaxy_config = ${ h.dumps( self.galaxy_config ) }; diff --git a/templates/webapps/galaxy/history/display.mako b/templates/webapps/galaxy/history/display.mako index ee64338e038..99c6948b208 100644 --- a/templates/webapps/galaxy/history/display.mako +++ b/templates/webapps/galaxy/history/display.mako @@ -49,7 +49,8 @@ hdaJSON = ${h.dumps( hda_dicts )}; require.config({ - baseUrl : "${h.url_for( '/static/scripts' )}" + baseUrl : "${h.url_for( '/static/scripts' )}", + urlArgs: 'v=${int(app.server_starttime)}' })([ 'mvc/history/history-panel-annotated' ], function( panelMod ){ // history module is already in the dpn chain from the panel. We can re-scope it here. var historyModel = require( 'mvc/history/history-model' ), diff --git a/templates/webapps/galaxy/history/embed.mako b/templates/webapps/galaxy/history/embed.mako index e11f803a66b..ca799aae7c2 100644 --- a/templates/webapps/galaxy/history/embed.mako +++ b/templates/webapps/galaxy/history/embed.mako @@ -48,7 +48,8 @@ $embeddedHistory = $( thisScript ).prev(); require.config({ - baseUrl : "${h.url_for( '/static/scripts' )}" + baseUrl : "${h.url_for( '/static/scripts' )}", + urlArgs: 'v=${int(app.server_starttime)}' }); require([ 'mvc/history/history-panel-annotated' ], function( panelMod ){ diff --git a/templates/webapps/galaxy/history/view.mako b/templates/webapps/galaxy/history/view.mako index 8eae02ed8c5..c433ed9bef6 100644 --- a/templates/webapps/galaxy/history/view.mako +++ b/templates/webapps/galaxy/history/view.mako @@ -177,7 +177,8 @@ a.btn { baseUrl : "${h.url_for( '/static/scripts' )}", paths : { 'jquery' : 'libs/jquery/jquery' - } + }, + urlArgs: 'v=${int(app.server_starttime)}' })([ 'mvc/user/user-model', panelToUse.location, diff --git a/templates/webapps/galaxy/root/tool_menu.mako b/templates/webapps/galaxy/root/tool_menu.mako index 0d53df56a41..546ee36fd67 100644 --- a/templates/webapps/galaxy/root/tool_menu.mako +++ b/templates/webapps/galaxy/root/tool_menu.mako @@ -9,7 +9,8 @@ baseUrl: "${h.url_for('/static/scripts')}", shim: { "libs/underscore": { exports: "_" } - } + }, + urlArgs: 'v=${int(app.server_starttime)}' }); require(["mvc/tools"], function(tools_mod) { diff --git a/templates/webapps/galaxy/visualization/display.mako b/templates/webapps/galaxy/visualization/display.mako index 5085fd7e6eb..e0c0795f7d7 100644 --- a/templates/webapps/galaxy/visualization/display.mako +++ b/templates/webapps/galaxy/visualization/display.mako @@ -58,7 +58,8 @@ shim: { "libs/underscore": { exports: "_" }, "libs/backbone/backbone": { exports: "Backbone" }, - } + }, + urlArgs: 'v=${int(app.server_starttime)}' }); require( ["viz/trackster"], function(trackster) { diff --git a/templates/webapps/galaxy/visualization/phyloviz.mako b/templates/webapps/galaxy/visualization/phyloviz.mako index 437c9f8e10b..82bf6e4b282 100644 --- a/templates/webapps/galaxy/visualization/phyloviz.mako +++ b/templates/webapps/galaxy/visualization/phyloviz.mako @@ -147,7 +147,8 @@ shim: { "libs/underscore": { exports: "_" }, "libs/d3": { exports: "d3" } - } + }, + urlArgs: 'v=${int(app.server_starttime)}' }); require(["viz/phyloviz"], function(phyloviz_mod) { diff --git a/templates/webapps/galaxy/visualization/sweepster.mako b/templates/webapps/galaxy/visualization/sweepster.mako index f0565839bee..44749b488bd 100644 --- a/templates/webapps/galaxy/visualization/sweepster.mako +++ b/templates/webapps/galaxy/visualization/sweepster.mako @@ -116,7 +116,8 @@ "libs/underscore": { exports: "_" }, "libs/d3": { exports: "d3" }, "libs/backbone/backbone": { exports: "Backbone" }, - } + }, + urlArgs: 'v=${int(app.server_starttime)}' }); require(["libs/d3", "viz/sweepster"], function(d3, sweepster) {