DSPACE - prevent caching
Date Issued
2017
Type
FAQ
Abstract
The following pages particularly can benefit from no caching
tools/edit-item-form.jsp
mydspace/home.jsp
display-item.jsp
Add the following to the imports for the jsp page
<%@page import="javax.servlet.http.HttpServletResponse" %>
Add the following to the very start of the mainline jsp code (after the declarations)
HttpServletResponse httpResponse = (HttpServletResponse) response; httpResponse.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1
httpResponse.setHeader("Pragma", "no-cache"); // HTTP 1.0
httpResponse.setDateHeader("Expires", 0); // Proxies.
tools/edit-item-form.jsp
mydspace/home.jsp
display-item.jsp
Add the following to the imports for the jsp page
<%@page import="javax.servlet.http.HttpServletResponse" %>
Add the following to the very start of the mainline jsp code (after the declarations)
HttpServletResponse httpResponse = (HttpServletResponse) response; httpResponse.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1
httpResponse.setHeader("Pragma", "no-cache"); // HTTP 1.0
httpResponse.setDateHeader("Expires", 0); // Proxies.
