This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new 9beff85 Avoid unnecessary cache revalidation.
9beff85 is described below
commit 9beff8511e69e3abbd2a6bc441753ba3c6946b24
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Jul 27 15:17:44 2021 +0100
Avoid unnecessary cache revalidation.
Any cache that understands cache-control is not going to need to the
expires header. Keep it in the securePagesWithPragma branch since that
is for old HTTP/1.0 proxies that may not understand cache-control.
---
java/org/apache/catalina/authenticator/AuthenticatorBase.java | 2 +-
webapps/docs/changelog.xml | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index 79b1bc5..550113c 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -553,10 +553,10 @@ public abstract class AuthenticatorBase extends ValveBase
// Note: These can cause problems with downloading files with
IE
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
+ response.setHeader("Expires", DATE_ONE);
} else {
response.setHeader("Cache-Control", "private");
}
- response.setHeader("Expires", DATE_ONE);
}
if (constraints != null) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 7bf0a16..123ddb4 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -123,6 +123,11 @@
<bug>65443</bug>: Refactor the <code>CorsFilter</code> to make it
easier
to extend. (markt)
</add>
+ <fix>
+ To avoid unnecessary cache revalidation, do not add an HTTP
+ <code>Expires</code> header when setting adding an HTTP header of
+ <code>CacheControl: private</code>. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]