From 5b6b0776ef109c8dd09f2437700bd4460e274c84 Mon Sep 17 00:00:00 2001 From: Stefan Matheis Date: Fri, 15 Mar 2013 20:36:01 +0000 Subject: [PATCH] SOLR-4311: Admin UI - Optimize Caching Behaviour git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1457099 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 2 ++ .../java/org/apache/solr/servlet/LoadAdminUiServlet.java | 8 ++++++-- solr/webapp/web/js/scripts/app.js | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 9aa6d91b141..25a8ea13701 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -129,6 +129,8 @@ Bug Fixes * SOLR-4585: The Collections API validates numShards with < 0 but should use <= 0. (Mark Miller) +* SOLR-4311: Admin UI - Optimize Caching Behaviour (steffkes) + Optimizations ---------------------- diff --git a/solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java b/solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java index f6e19ef0c88..37cd8309fb2 100644 --- a/solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java +++ b/solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java @@ -30,6 +30,7 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringEscapeUtils; import org.apache.solr.core.CoreContainer; +import org.apache.solr.core.SolrCore; /** * A simple servlet to load the Solr Admin UI @@ -53,14 +54,17 @@ public final class LoadAdminUiServlet extends HttpServlet { Writer out = new OutputStreamWriter(response.getOutputStream(), "UTF-8"); String html = IOUtils.toString(in, "UTF-8"); + Package package = SolrCore.class.getPackage(); String[] search = new String[] { "${contextPath}", - "${adminPath}" + "${adminPath}", + "${version}" }; String[] replace = new String[] { StringEscapeUtils.escapeJavaScript(request.getContextPath()), - StringEscapeUtils.escapeJavaScript(cores.getAdminPath()) + StringEscapeUtils.escapeJavaScript(cores.getAdminPath()), + StringEscapeUtils.escapeJavaScript(package.getSpecificationVersion()) }; out.write( StringUtils.replaceEach(html, search, replace) ); diff --git a/solr/webapp/web/js/scripts/app.js b/solr/webapp/web/js/scripts/app.js index 3a21cc89b27..e7d51570429 100644 --- a/solr/webapp/web/js/scripts/app.js +++ b/solr/webapp/web/js/scripts/app.js @@ -585,4 +585,5 @@ var solr_admin = function( app_config ) }; +$.ajaxSetup( { cache: false } ); var app = new solr_admin( app_config );