Fixes for caching issue with PageRenderer freemarker template processing

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6905 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-10-03 09:30:14 +00:00
parent 4403c1d083
commit b26870416a
3 changed files with 17 additions and 1 deletions

View File

@@ -174,6 +174,8 @@ public class PageRendererServlet extends WebScriptServlet
}
}
setNoCacheHeaders(res);
try
{
// lookup template path from page config in website AVM store
@@ -447,6 +449,15 @@ public class PageRendererServlet extends WebScriptServlet
(page != null ? page + '/' : "") + "page-definition.xml";
}
/**
* Apply the headers required to disallow caching of the response in the browser
*/
private static void setNoCacheHeaders(HttpServletResponse res)
{
res.setHeader("Cache-Control", "no-cache");
res.setHeader("Pragma", "no-cache");
}
/**
* WebScript runtime for the PageRenderer servlet.
@@ -707,7 +718,7 @@ public class PageRendererServlet extends WebScriptServlet
public long getLastModified(Object templateSource)
{
return last--;
return last++;
}
public Reader getReader(Object templateSource, String encoding) throws IOException