Mod expires not working

Discussion in 'Install/Configuration' started by Yogesh Sarkar, Jun 7, 2012.

  1. Yogesh Sarkar

    Yogesh Sarkar Banned

    I have an issue where mod expires is not working for any of my websites.

    I have it enabled it globally in HTPPD.conf

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault A0
    FileETag None
    <FilesMatch "\.(gif|jpg|jpeg|png|js|css|ico|JPG)$">
    ExpiresDefault "access plus 10 days"
    Header append Cache-Control "public"
    </FilesMatch>
    </IfModule>

    As well as in Litespeed configuration

    Enable Expires Yes

    Expires Default Not Set

    Expires By Type image/*=A604800, text/css=A604800, application/x-javascript=A604800, application/javascript=A604800

    Using PHP suEXEC and Litespeed dedicatedly with Load Apache Configuration set to Yes.
  2. webizen

    webizen New Member

    Can you elaborate the 'not working'? Does 'Expires' or 'Cache-Control' header not show up at all or something else?
  3. Yogesh Sarkar

    Yogesh Sarkar Banned

    When I test my vbulletin forum using pagespeed or numerous other site testing tools, all of them tell me that the png files have no expiation specified.

    I added png explicitly in the litespeed configuration, but to no avail.

    You can check my site if you want at www.bcmtouring.com/forum/
  4. webizen

    webizen New Member

    what is your LSWS version? do you have anything in .htaccess override the expires? also, remove 'image/*=A604800' from lsws config and see if apache defined 'ExpiresDefault "access plus 10 days"' is effective for png.
  5. Yogesh Sarkar

    Yogesh Sarkar Banned

    4.1.12 and nothing in .htaccess, because vbseo rules are loaded in httpd.conf.

    Removed the image/*=A604800 from the LSWS config and didn't make any difference.
  6. webizen

    webizen New Member

    unable to reproduce your issue in our lab. try comment out the mod_expires section in httpd.conf and see any difference.
  7. Yogesh Sarkar

    Yogesh Sarkar Banned

    Removed mod_expires and it made no difference. Could it be that this module isn't loaded?
  8. webizen

    webizen New Member

    Looks good to me.

    ~$ curl -I http://www.bcmtouring.com/forum/images/icons/icon6.png
    HTTP/1.1 200 OK
    Date: Fri, 08 Jun 2012 23:53:38 GMT
    Server: LiteSpeed
    Accept-Ranges: bytes
    Connection: Keep-Alive
    Keep-Alive: timeout=5, max=100
    ETag: "324-4fc95ad6-0"
    Last-Modified: Sat, 02 Jun 2012 00:14:14 GMT
    Content-Type: image/png
    Content-Length: 804
    Cache-Control: max-age=604800
    Expires: Fri, 15 Jun 2012 23:53:38 GMT
  9. Yogesh Sarkar

    Yogesh Sarkar Banned

    Yes it just started working, after I individually listed image mime types in litespeed.

    Thanks :).

Share This Page