You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2017/06/06 01:42:09 UTC

[Bug 61156] New: ExpiresFilter is not working

https://bz.apache.org/bugzilla/show_bug.cgi?id=61156

            Bug ID: 61156
           Summary: ExpiresFilter is not working
           Product: Tomcat 8
           Version: 8.5.15
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: brian@databaseknowledge.com
  Target Milestone: ----

In web.xml file I added the standard ExpiresFilter syntax:

        <filter>
         <filter-name>ExpiresFilter</filter-name>
         <filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class>
         <init-param>
                <param-name>ExpiresByType image</param-name>
                <param-value>access plus 5 weeks</param-value>
         </init-param>
         <init-param>
                <param-name>ExpiresByType text/css</param-name>
                <param-value>access plus 5 weeks</param-value>
         </init-param>
         <init-param>
                <param-name>ExpiresByType application/javascript</param-name>
                <param-value>access plus 5 weeks</param-value>
         </init-param>
        </filter>

        <filter-mapping>
                <filter-name>ExpiresFilter</filter-name>
                <url-pattern>/cache/*</url-pattern>
        </filter-mapping>

The headers are missing the Cache-Control header:

Accept-Ranges:bytes
Content-Length:1384282
Content-Type:application/javascript
Date:Tue, 06 Jun 2017 04:38:11 GMT
ETag:W/"1384282-1494926612738"
Last-Modified:Tue, 16 May 2017 09:23:32 GMT


Note that the /cache path is defined as:

<Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
  <Context docBase="C:\_portal\webroot\cache" path="/cache" />          

I do not think this matters as I tried the /example/* path and this has the
same problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 61156] ExpiresFilter is not working

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61156

--- Comment #2 from Brian McGinity <br...@databaseknowledge.com> ---
Thank you for your response. So I understand what to ask the mailing list...

You're saying is <url-pattern>/cache/*</url-pattern> will match paths along the
lines of: 

http://site.com/cache/cache/file.js
http://site.com/cache/cache/file.css

and it will not match:

http://site.com/cache/file.js
http://site.com/cache/file.css

That seems odd, not sure if I understand that.  I will ask the mailing list.

Also thank you for letting me know about context definitions inside of
server.xml.  Yeah, I just read that this is bad practice because it cannot be
changed without restarting. It looks like this can be moved to 
/META-INF/context.xml.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 61156] ExpiresFilter is not working

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61156

Felix Schumacher <fe...@internetallee.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Felix Schumacher <fe...@internetallee.de> ---
I believe this question belongs on the user mailing list.

The filter path expression is relative to the context, so it will only match on
elements /path/path/* with your config.

Also note, that it is bad practice to put your context definitions inside of
server.xml.

Feel free to reopen, if discussion on the users mailing list indicate a real
bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org