Commit 1923e54e authored by Piotr Gawron's avatar Piotr Gawron
Browse files

headers to disable query caching added

parent 6b2a11b5
......@@ -8,6 +8,8 @@ minerva (12.2.1) stable; urgency=medium
privileges (#766)
* Bug fix: invalid pubmed identifier could break clicking on element
containing it (#764, #765, #769)
* Bug fix: cache for API queries is explicitly disabled - some queries could
be mistakenly cached and the system behaviour might get unstable (#771)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 1 Apr 2019 17:00:00 +0200
......
......@@ -13,7 +13,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
/**
* This filter enables x-frames from another domain if necessary.
* This filter disables caching for API queries.
*
* @author Piotr Gawron
*
......@@ -33,7 +33,12 @@ public class ApiAccessControlFilter implements Filter {
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
throws IOException, ServletException {
HttpServletResponse response = (HttpServletResponse) res;
//caching on Safari
response.addHeader("Vary", "*");
// generic cache prevent mechanism
response.addHeader("Cache-Control", "no-cache, no-store, must-revalidate");
response.addHeader("Pragma", "no-cache");
response.addHeader("Expires", "0");
chain.doFilter(req, response);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment