View | Details | Raw Unified | Return to bug 49617
Collapse All | Expand All

(-)webapps/docs/config/filter.xml (-7 / +5 lines)
Lines 319-325 Link Here
319
    <tt>max-age</tt> directive of the <tt>Cache-Control</tt> header),</li>
319
    <tt>max-age</tt> directive of the <tt>Cache-Control</tt> header),</li>
320
    <li>the response status code is not excluded by the directive
320
    <li>the response status code is not excluded by the directive
321
    <tt>ExpiresExcludedResponseStatusCodes</tt>,</li>
321
    <tt>ExpiresExcludedResponseStatusCodes</tt>,</li>
322
    <li>The <tt>Content-Type</tt> of the response matches one of the types
322
    <li>the <tt>Content-Type</tt> of the response matches one of the types
323
    defined the in <tt>ExpiresByType</tt> directives or the
323
    defined the in <tt>ExpiresByType</tt> directives or the
324
    <tt>ExpiresDefault</tt> directive is defined.</li>
324
    <tt>ExpiresDefault</tt> directive is defined.</li>
325
    </ol>
325
    </ol>
Lines 446-453 Link Here
446
&lt;/init-param&gt;
446
&lt;/init-param&gt;
447
         </source>
447
         </source>
448
         <p>
448
         <p>
449
         Note that this directive only has effect if <tt>ExpiresActive On</tt> has
449
         It overrides, for the specified MIME type <i>only</i>, any
450
         been specified. It overrides, for the specified MIME type <i>only</i>, any
451
         expiration date set by the <tt>ExpiresDefault</tt> directive.
450
         expiration date set by the <tt>ExpiresDefault</tt> directive.
452
         </p>
451
         </p>
453
         <p>
452
         <p>
Lines 483-495 Link Here
483
org.apache.catalina.filters.ExpiresFilter.level = FINE
482
org.apache.catalina.filters.ExpiresFilter.level = FINE
484
    </source>
483
    </source>
485
    <p>
484
    <p>
486
    Sample of initialization log message :
485
    Sample of initialization log message:
487
    </p>
486
    </p>
488
    
487
    
489
    <source>
488
    <source>
490
Mar 26, 2010 2:01:41 PM org.apache.catalina.filters.ExpiresFilter init
489
Mar 26, 2010 2:01:41 PM org.apache.catalina.filters.ExpiresFilter init
491
FINE: Filter initialized with configuration ExpiresFilter[
490
FINE: Filter initialized with configuration ExpiresFilter[
492
 active=true, 
493
 excludedResponseStatusCode=[304], 
491
 excludedResponseStatusCode=[304], 
494
 default=null, 
492
 default=null, 
495
 byType={
493
 byType={
Lines 499-505 Link Here
499
    </source>
497
    </source>
500
    <p>
498
    <p>
501
    Sample of per-request log message where <tt>ExpiresFilter</tt> adds an
499
    Sample of per-request log message where <tt>ExpiresFilter</tt> adds an
502
    expiration date
500
    expiration date:
503
    </p>
501
    </p>
504
    
502
    
505
    <source>
503
    <source>
Lines 508-514 Link Here
508
    </source>
506
    </source>
509
    <p>
507
    <p>
510
    Sample of per-request log message where <tt>ExpiresFilter</tt> does not add
508
    Sample of per-request log message where <tt>ExpiresFilter</tt> does not add
511
    an expiration date
509
    an expiration date:
512
    </p>
510
    </p>
513
    
511
    
514
    <source>
512
    <source>
(-)test/org/apache/catalina/filters/TestExpiresFilter.java (-1 lines)
Lines 59-65 Link Here
59
                "modification plus 5 hours 3 minutes");
59
                "modification plus 5 hours 3 minutes");
60
        filterDef.addInitParameter("ExpiresByType image/jpg", "A10000");
60
        filterDef.addInitParameter("ExpiresByType image/jpg", "A10000");
61
        filterDef.addInitParameter("ExpiresByType video/mpeg", "M20000");
61
        filterDef.addInitParameter("ExpiresByType video/mpeg", "M20000");
62
        filterDef.addInitParameter("ExpiresActive", "Off");
63
        filterDef.addInitParameter("ExpiresExcludedResponseStatusCodes",
62
        filterDef.addInitParameter("ExpiresExcludedResponseStatusCodes",
64
                "304, 503");
63
                "304, 503");
65
64
(-)java/org/apache/catalina/filters/ExpiresFilter.java (-39 / +2 lines)
Lines 110-152 Link Here
110
 * &lt;/web-app&gt;
110
 * &lt;/web-app&gt;
111
 * </pre></code>
111
 * </pre></code>
112
 * 
112
 * 
113
 * <h2>Configuration Parameters</h2><h3>
113
 * <h2>Configuration Parameters</h2>
114
 * <tt>ExpiresActive</tt></h3>
115
 * <p>
116
 * This directive enables or disables the generation of the <tt>Expires</tt> and
117
 * <tt>Cache-Control</tt> headers by this <tt>ExpiresFilter</tt>. If set to
118
 * <tt>Off</tt>, the headers will not be generated for any HTTP response. If set
119
 * to <tt>On</tt> or <tt>true</tt>, the headers will be added to served HTTP
120
 * responses according to the criteria defined by the
121
 * <tt>ExpiresByType &lt;content-type&gt;</tt> and <tt>ExpiresDefault</tt>
122
 * directives. Note that this directive does not guarantee that an
123
 * <tt>Expires</tt> or <tt>Cache-Control</tt> header will be generated. If the
124
 * criteria aren&#x27;t met, no header will be sent, and the effect will be as
125
 * though this directive wasn&#x27;t even specified.
126
 * </p>
127
 * <p>
128
 * This parameter is optional, default value is <tt>true</tt>.
129
 * </p>
130
 * <p>
131
 * <i>Enable filter</i>
132
 * </p>
133
 * 
134
 * <code><pre>
135
 * &lt;init-param&gt;
136
 *    &lt;!-- supports case insensitive &#x27;On&#x27; or &#x27;true&#x27; --&gt;
137
 *    &lt;param-name&gt;ExpiresActive&lt;/param-name&gt;&lt;param-value&gt;On&lt;/param-value&gt;
138
 * &lt;/init-param&gt;
139
 * </pre></code>
140
 * <p>
141
 * <i>Disable filter</i>
142
 * </p>
143
 * 
144
 * <code><pre>
145
 * &lt;init-param&gt;
146
 *    &lt;!-- supports anything different from case insensitive &#x27;On&#x27; and &#x27;true&#x27; --&gt;
147
 *    &lt;param-name&gt;ExpiresActive&lt;/param-name&gt;&lt;param-value&gt;Off&lt;/param-value&gt;
148
 * &lt;/init-param&gt;
149
 * </pre></code>
150
 * 
114
 * 
151
 * <h3>
115
 * <h3>
152
 * <tt>ExpiresByType &lt;content-type&gt;</tt></h3>
116
 * <tt>ExpiresByType &lt;content-type&gt;</tt></h3>
Lines 316-322 Link Here
316
 * <tt>max-age</tt> directive of the <tt>Cache-Control</tt> header),</li>
280
 * <tt>max-age</tt> directive of the <tt>Cache-Control</tt> header),</li>
317
 * <li>the response status code is not excluded by the directive
281
 * <li>the response status code is not excluded by the directive
318
 * <tt>ExpiresExcludedResponseStatusCodes</tt>,</li>
282
 * <tt>ExpiresExcludedResponseStatusCodes</tt>,</li>
319
 * <li>The <tt>Content-Type</tt> of the response matches one of the types
283
 * <li>the <tt>Content-Type</tt> of the response matches one of the types
320
 * defined the in <tt>ExpiresByType</tt> directives or the
284
 * defined the in <tt>ExpiresByType</tt> directives or the
321
 * <tt>ExpiresDefault</tt> directive is defined.</li>
285
 * <tt>ExpiresDefault</tt> directive is defined.</li>
322
 * </ol>
286
 * </ol>
Lines 412-418 Link Here
412
 * <code><pre>
376
 * <code><pre>
413
 * Mar 26, 2010 2:01:41 PM org.apache.catalina.filters.ExpiresFilter init
377
 * Mar 26, 2010 2:01:41 PM org.apache.catalina.filters.ExpiresFilter init
414
 * FINE: Filter initialized with configuration ExpiresFilter[
378
 * FINE: Filter initialized with configuration ExpiresFilter[
415
 *    active=true, 
416
 *    excludedResponseStatusCode=[304], 
379
 *    excludedResponseStatusCode=[304], 
417
 *    default=null, 
380
 *    default=null, 
418
 *    byType={
381
 *    byType={

Return to bug 49617