Bug 60804 - ExpiresByType and ExpiresDefault is ignored when used SetHandler application/x-httpd-php
Summary: ExpiresByType and ExpiresDefault is ignored when used SetHandler application/...
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_expires (show other bugs)
Version: 2.4.25
Hardware: All All
: P2 major with 1 vote (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2017-03-02 15:19 UTC by Binyamin
Modified: 2017-03-02 15:24 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Binyamin 2017-03-02 15:19:36 UTC
/sitemap.xml Response Headers shows 1 day expiration while expected to be 1 year (or at least 1 week)

    Content-Type: application/xml; charset=utf-8
    Date:         Tue, 27 Dec 2016 19:59:00 GMT
    Expires:      Wed, 28 Dec 2016 19:59:00 GMT

seems SetHandler forces text/html expiration and doesn't allow to rewrite it

    ExpiresActive On
    ExpiresDefault                "access plus 1 month"
    ExpiresByType text/html       "access plus 1 day"
    ExpiresByType application/xml "access plus 1 week"

    <FilesMatch ^sitemap\.xml$>
        SetHandler application/x-httpd-php
        Header set Content-Type "application/xml"
        ExpiresDefault "access plus 1 year"

the loaded modules order doesn't fix it either

LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so