summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorFabian Lange <lange.fabian@gmail.com>2014-07-23 22:40:35 +0200
committerVaadin Code Review <review@vaadin.com>2015-01-11 15:09:51 +0000
commit65904ffbdebc861a45c1b504d244d02a12f4561b (patch)
treec7e57a8f80a5506f3256d2bee73d52031e724932 /server
parent0f71cf690dacbaacd42a8fa586dd127b73addca1 (diff)
downloadvaadin-framework-65904ffbdebc861a45c1b504d244d02a12f4561b.tar.gz
vaadin-framework-65904ffbdebc861a45c1b504d244d02a12f4561b.zip
Appending query param with vaadin version to js files (#12210)
while #7868 is supposed to solve the overall issue, this solves a big part of the upgrade + cached files issues quickly. When I use vaadin themes, I have control over how they are included, so I can add a vaadin version number to it. For the default JS I cannot. Change-Id: Ica1cddee417946aa32116eb09882a3dc6c2924a6
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/server/BootstrapHandler.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java
index 30e43f48a8..c45e2b70e0 100644
--- a/server/src/com/vaadin/server/BootstrapHandler.java
+++ b/server/src/com/vaadin/server/BootstrapHandler.java
@@ -414,6 +414,9 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler {
String vaadinLocation = vaadinService.getStaticFileLocation(request)
+ "/VAADIN/";
+ // Parameter appended to JS to bypass caches after version upgrade.
+ String versionQueryParam = "?v=" + Version.getFullVersion();
+
if (context.getPushMode().isEnabled()) {
// Load client-side dependencies for push support
String pushJS = vaadinLocation;
@@ -424,12 +427,14 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler {
pushJS += ApplicationConstants.VAADIN_PUSH_DEBUG_JS;
}
+ pushJS += versionQueryParam;
+
fragmentNodes.add(new Element(Tag.valueOf("script"), "").attr(
"type", "text/javascript").attr("src", pushJS));
}
String bootstrapLocation = vaadinLocation
- + ApplicationConstants.VAADIN_BOOTSTRAP_JS;
+ + ApplicationConstants.VAADIN_BOOTSTRAP_JS + versionQueryParam;
fragmentNodes.add(new Element(Tag.valueOf("script"), "").attr("type",
"text/javascript").attr("src", bootstrapLocation));
Element mainScriptTag = new Element(Tag.valueOf("script"), "").attr(
@@ -613,7 +618,7 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler {
}
/**
- * Don not override.
+ * Do not override.
*
* @param context
* @return