From 2d072c38447052b9d4334d05dcbe36bb71b4531b Mon Sep 17 00:00:00 2001 From: Pavlo Tkach <3469726+ptkach@users.noreply.github.com> Date: Fri, 28 Mar 2025 15:53:02 -0400 Subject: [PATCH] Update jetty console static files cache policies (#2731) --- jetty/build.gradle | 2 +- .../webapps/console/WEB-INF/web.xml | 54 +++++++++++++++++++ jetty/start.sh | 6 ++- 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 jetty/src/main/jetty-base/webapps/console/WEB-INF/web.xml diff --git a/jetty/build.gradle b/jetty/build.gradle index 9af6f8cc6..aa43bf166 100644 --- a/jetty/build.gradle +++ b/jetty/build.gradle @@ -38,7 +38,7 @@ dependencies { tasks.register('copyConsole', Copy) { from("${rootDir}/console-webapp/staged/") { - include "console-*/*" + include "console-*/", "console-*/**" } into layout.buildDirectory.dir('jetty-base/webapps/') dependsOn(':console-webapp:buildConsoleForAll') diff --git a/jetty/src/main/jetty-base/webapps/console/WEB-INF/web.xml b/jetty/src/main/jetty-base/webapps/console/WEB-INF/web.xml new file mode 100644 index 000000000..aaa3eed94 --- /dev/null +++ b/jetty/src/main/jetty-base/webapps/console/WEB-INF/web.xml @@ -0,0 +1,54 @@ + + + + default-no-cache + org.eclipse.jetty.ee10.servlet.DefaultServlet + + cacheControl + no-cache, no-store, must-revalidate + + + + + default-cache-static + org.eclipse.jetty.ee10.servlet.DefaultServlet + + cacheControl + public, max-age=604800 + + + + + default-no-cache + *.html + + + + default-no-cache + main.js + + + + default-no-cache + styles.css + + + + default-cache-static + *.css + + + + default-cache-static + *.js + + + + default-cache-static + *.png + + + diff --git a/jetty/start.sh b/jetty/start.sh index 79c1dc848..c33aec75a 100755 --- a/jetty/start.sh +++ b/jetty/start.sh @@ -15,7 +15,11 @@ env=${1:-"alpha"} cd /jetty-base -cp -rf webapps/console-${env} webapps/console +cp -rf webapps/console-${env}/. webapps/console/ +cd webapps +# Remove all environment builds not used in the deployment +find . -maxdepth 1 -type d -name "console-*" -exec rm -rf {} + +cd /jetty-base echo "Running ${env}" java -Dgoogle.registry.environment=${env} \ -Djava.util.logging.config.file=/logging.properties \