Skip to content
Snippets Groups Projects
Commit 1923e54e authored by Piotr Gawron's avatar Piotr Gawron
Browse files

headers to disable query caching added

parent 6b2a11b5
No related branches found
No related tags found
3 merge requests!724Merge 12.2.1,!72312.2.1 into master,!722remove comment is disabled for users without proper privileges
Pipeline #9567 passed
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment