This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.0.x by this push: new aa40d04 Avoid unnecessary cache revalidation. aa40d04 is described below commit aa40d041ea1625734dce43e3198afb1258f5369a Author: Mark Thomas <ma...@apache.org> 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 faf98cb..d751582 100644 --- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java +++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java @@ -552,10 +552,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 e323f45..8209037 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: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org