diff options
Diffstat (limited to 'subprojects/language-web/src/main/java/tools/refinery/language/web/CacheControlFilter.java')
-rw-r--r-- | subprojects/language-web/src/main/java/tools/refinery/language/web/CacheControlFilter.java | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/subprojects/language-web/src/main/java/tools/refinery/language/web/CacheControlFilter.java b/subprojects/language-web/src/main/java/tools/refinery/language/web/CacheControlFilter.java index 8ac8a21e..fbce62c1 100644 --- a/subprojects/language-web/src/main/java/tools/refinery/language/web/CacheControlFilter.java +++ b/subprojects/language-web/src/main/java/tools/refinery/language/web/CacheControlFilter.java | |||
@@ -1,21 +1,15 @@ | |||
1 | package tools.refinery.language.web; | 1 | package tools.refinery.language.web; |
2 | 2 | ||
3 | import jakarta.servlet.*; | ||
4 | import jakarta.servlet.http.HttpServletRequest; | ||
5 | import jakarta.servlet.http.HttpServletResponse; | ||
6 | import org.eclipse.jetty.http.HttpHeader; | ||
7 | |||
3 | import java.io.IOException; | 8 | import java.io.IOException; |
4 | import java.time.Duration; | 9 | import java.time.Duration; |
5 | import java.util.Set; | 10 | import java.util.Set; |
6 | import java.util.regex.Pattern; | 11 | import java.util.regex.Pattern; |
7 | 12 | ||
8 | import org.eclipse.jetty.http.HttpHeader; | ||
9 | |||
10 | import jakarta.servlet.Filter; | ||
11 | import jakarta.servlet.FilterChain; | ||
12 | import jakarta.servlet.FilterConfig; | ||
13 | import jakarta.servlet.ServletException; | ||
14 | import jakarta.servlet.ServletRequest; | ||
15 | import jakarta.servlet.ServletResponse; | ||
16 | import jakarta.servlet.http.HttpServletRequest; | ||
17 | import jakarta.servlet.http.HttpServletResponse; | ||
18 | |||
19 | public class CacheControlFilter implements Filter { | 13 | public class CacheControlFilter implements Filter { |
20 | private static final Pattern CACHE_URI_PATTERN = Pattern.compile(".*\\.(css|gif|js|map|png|svg|woff2?)"); | 14 | private static final Pattern CACHE_URI_PATTERN = Pattern.compile(".*\\.(css|gif|js|map|png|svg|woff2?)"); |
21 | 15 | ||
@@ -29,11 +23,6 @@ public class CacheControlFilter implements Filter { | |||
29 | private static final String CACHE_CONTROL_NO_CACHE_VALUE = "no-cache, no-store, max-age: 0, must-revalidate"; | 23 | private static final String CACHE_CONTROL_NO_CACHE_VALUE = "no-cache, no-store, max-age: 0, must-revalidate"; |
30 | 24 | ||
31 | @Override | 25 | @Override |
32 | public void init(FilterConfig filterConfig) throws ServletException { | ||
33 | // Nothing to initialize. | ||
34 | } | ||
35 | |||
36 | @Override | ||
37 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) | 26 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) |
38 | throws IOException, ServletException { | 27 | throws IOException, ServletException { |
39 | if (request instanceof HttpServletRequest httpRequest && response instanceof HttpServletResponse httpResponse) { | 28 | if (request instanceof HttpServletRequest httpRequest && response instanceof HttpServletResponse httpResponse) { |
@@ -49,9 +38,4 @@ public class CacheControlFilter implements Filter { | |||
49 | } | 38 | } |
50 | chain.doFilter(request, response); | 39 | chain.doFilter(request, response); |
51 | } | 40 | } |
52 | |||
53 | @Override | ||
54 | public void destroy() { | ||
55 | // Nothing to dispose. | ||
56 | } | ||
57 | } | 41 | } |