diff options
author | James Moger <james.moger@gitblit.com> | 2013-07-19 10:46:16 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-07-19 10:50:32 -0400 |
commit | a7db5748622e1b322b67fbbd72aed4e6efff7690 (patch) | |
tree | 90e5ff60ee365da5b32388cfd790382672dbc232 /src/main/java/com/gitblit/PagesServlet.java | |
parent | 0bfd34316b5903c29f93b352f0aa8e8cdce51cad (diff) | |
download | gitblit-a7db5748622e1b322b67fbbd72aed4e6efff7690.tar.gz gitblit-a7db5748622e1b322b67fbbd72aed4e6efff7690.zip |
Implemented optional page caching
Diffstat (limited to 'src/main/java/com/gitblit/PagesServlet.java')
-rw-r--r-- | src/main/java/com/gitblit/PagesServlet.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/PagesServlet.java b/src/main/java/com/gitblit/PagesServlet.java index 9516b357..fc71bc50 100644 --- a/src/main/java/com/gitblit/PagesServlet.java +++ b/src/main/java/com/gitblit/PagesServlet.java @@ -141,7 +141,6 @@ public class PagesServlet extends HttpServlet { r.close();
return;
}
- response.setDateHeader("Last-Modified", JGitUtils.getCommitDate(commit).getTime());
String [] encodings = GitBlit.getEncodings();
@@ -226,6 +225,8 @@ public class PagesServlet extends HttpServlet { try {
// output the content
+ response.setHeader("Cache-Control", "public, max-age=3600, must-revalidate");
+ response.setDateHeader("Last-Modified", JGitUtils.getCommitDate(commit).getTime());
response.getOutputStream().write(content);
response.flushBuffer();
} catch (Throwable t) {
|