You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/07/21 18:37:58 UTC
svn commit: r966304 - in /tomcat/trunk:
java/org/apache/catalina/filters/ExpiresFilter.java
test/org/apache/catalina/filters/TestExpiresFilter.java
webapps/docs/changelog.xml webapps/docs/config/filter.xml
Author: markt
Date: Wed Jul 21 16:37:58 2010
New Revision: 966304
URL: http://svn.apache.org/viewvc?rev=966304&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49617
Correct the ExpiresFilter documentation after changes to the submitted patch
Modified:
tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java
tomcat/trunk/test/org/apache/catalina/filters/TestExpiresFilter.java
tomcat/trunk/webapps/docs/changelog.xml
tomcat/trunk/webapps/docs/config/filter.xml
Modified: tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java?rev=966304&r1=966303&r2=966304&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java Wed Jul 21 16:37:58 2010
@@ -110,43 +110,7 @@ import org.apache.juli.logging.LogFactor
* </web-app>
* </pre></code>
*
- * <h2>Configuration Parameters</h2><h3>
- * <tt>ExpiresActive</tt></h3>
- * <p>
- * This directive enables or disables the generation of the <tt>Expires</tt> and
- * <tt>Cache-Control</tt> headers by this <tt>ExpiresFilter</tt>. If set to
- * <tt>Off</tt>, the headers will not be generated for any HTTP response. If set
- * to <tt>On</tt> or <tt>true</tt>, the headers will be added to served HTTP
- * responses according to the criteria defined by the
- * <tt>ExpiresByType <content-type></tt> and <tt>ExpiresDefault</tt>
- * directives. Note that this directive does not guarantee that an
- * <tt>Expires</tt> or <tt>Cache-Control</tt> header will be generated. If the
- * criteria aren't met, no header will be sent, and the effect will be as
- * though this directive wasn't even specified.
- * </p>
- * <p>
- * This parameter is optional, default value is <tt>true</tt>.
- * </p>
- * <p>
- * <i>Enable filter</i>
- * </p>
- *
- * <code><pre>
- * <init-param>
- * <!-- supports case insensitive 'On' or 'true' -->
- * <param-name>ExpiresActive</param-name><param-value>On</param-value>
- * </init-param>
- * </pre></code>
- * <p>
- * <i>Disable filter</i>
- * </p>
- *
- * <code><pre>
- * <init-param>
- * <!-- supports anything different from case insensitive 'On' and 'true' -->
- * <param-name>ExpiresActive</param-name><param-value>Off</param-value>
- * </init-param>
- * </pre></code>
+ * <h2>Configuration Parameters</h2>
*
* <h3>
* <tt>ExpiresByType <content-type></tt></h3>
@@ -316,7 +280,7 @@ import org.apache.juli.logging.LogFactor
* <tt>max-age</tt> directive of the <tt>Cache-Control</tt> header),</li>
* <li>the response status code is not excluded by the directive
* <tt>ExpiresExcludedResponseStatusCodes</tt>,</li>
- * <li>The <tt>Content-Type</tt> of the response matches one of the types
+ * <li>the <tt>Content-Type</tt> of the response matches one of the types
* defined the in <tt>ExpiresByType</tt> directives or the
* <tt>ExpiresDefault</tt> directive is defined.</li>
* </ol>
@@ -412,7 +376,6 @@ import org.apache.juli.logging.LogFactor
* <code><pre>
* Mar 26, 2010 2:01:41 PM org.apache.catalina.filters.ExpiresFilter init
* FINE: Filter initialized with configuration ExpiresFilter[
- * active=true,
* excludedResponseStatusCode=[304],
* default=null,
* byType={
Modified: tomcat/trunk/test/org/apache/catalina/filters/TestExpiresFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/filters/TestExpiresFilter.java?rev=966304&r1=966303&r2=966304&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/filters/TestExpiresFilter.java (original)
+++ tomcat/trunk/test/org/apache/catalina/filters/TestExpiresFilter.java Wed Jul 21 16:37:58 2010
@@ -59,7 +59,6 @@ public class TestExpiresFilter extends T
"modification plus 5 hours 3 minutes");
filterDef.addInitParameter("ExpiresByType image/jpg", "A10000");
filterDef.addInitParameter("ExpiresByType video/mpeg", "M20000");
- filterDef.addInitParameter("ExpiresActive", "Off");
filterDef.addInitParameter("ExpiresExcludedResponseStatusCodes",
"304, 503");
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=966304&r1=966303&r2=966304&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Jul 21 16:37:58 2010
@@ -66,8 +66,8 @@
disabled by default. Based on a patch by Yair Lenga. (markt)
</add>
<add>
- <bug>48998</bug>: Add the ExpiresFilter, a port of the httpd mod_expires
- module. Patch provided by Cyrille Le Clerc. (markt)
+ <bug>48998</bug>, <bug>49617</bug>: Add the ExpiresFilter, a port of the
+ httpd mod_expires module. Patch provided by Cyrille Le Clerc. (markt)
</add>
<fix>
<bug>49030</bug>: When initializing/starting/stopping connectors and
Modified: tomcat/trunk/webapps/docs/config/filter.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/filter.xml?rev=966304&r1=966303&r2=966304&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/filter.xml (original)
+++ tomcat/trunk/webapps/docs/config/filter.xml Wed Jul 21 16:37:58 2010
@@ -319,7 +319,7 @@ The expiry time can be fine-tuned by add
<tt>max-age</tt> directive of the <tt>Cache-Control</tt> header),</li>
<li>the response status code is not excluded by the directive
<tt>ExpiresExcludedResponseStatusCodes</tt>,</li>
- <li>The <tt>Content-Type</tt> of the response matches one of the types
+ <li>the <tt>Content-Type</tt> of the response matches one of the types
defined the in <tt>ExpiresByType</tt> directives or the
<tt>ExpiresDefault</tt> directive is defined.</li>
</ol>
@@ -446,8 +446,7 @@ The expiry time can be fine-tuned by add
</init-param>
</source>
<p>
- Note that this directive only has effect if <tt>ExpiresActive On</tt> has
- been specified. It overrides, for the specified MIME type <i>only</i>, any
+ It overrides, for the specified MIME type <i>only</i>, any
expiration date set by the <tt>ExpiresDefault</tt> directive.
</p>
<p>
@@ -483,13 +482,12 @@ The expiry time can be fine-tuned by add
org.apache.catalina.filters.ExpiresFilter.level = FINE
</source>
<p>
- Sample of initialization log message :
+ Sample of initialization log message:
</p>
<source>
Mar 26, 2010 2:01:41 PM org.apache.catalina.filters.ExpiresFilter init
FINE: Filter initialized with configuration ExpiresFilter[
- active=true,
excludedResponseStatusCode=[304],
default=null,
byType={
@@ -499,7 +497,7 @@ FINE: Filter initialized with configurat
</source>
<p>
Sample of per-request log message where <tt>ExpiresFilter</tt> adds an
- expiration date
+ expiration date:
</p>
<source>
@@ -508,7 +506,7 @@ FINE: Request "/tomcat.gif" with respons
</source>
<p>
Sample of per-request log message where <tt>ExpiresFilter</tt> does not add
- an expiration date
+ an expiration date:
</p>
<source>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org