htaccess Cache-Control ignored

Discussion in 'Apache Migration/Compatibility' started by Mahks, Jan 15, 2013.

  1. Mahks

    Mahks New Member

    The following directive is in htaccess in domain/cached, it works in apache but seems to be ignored in litespeed.

    <FilesMatch "\.(php)$">
    Header set Cache-Control "max-age=31536000, public"
    </FilesMatch>

    When placed in the domain directory htaccess, it is applied, but then it is applied to all sub-directories.

    What is the difference between litespeed & apache for this?

    Edit:
    I have been told by my hosting service that litespeed does not support htaccess in sub-folders.
    Is this true? How do you set caching for different directories?
    Last edited: Jan 17, 2013
  2. dgtl

    dgtl New Member

    I don't think this is true. I have LSWS 4.2.1 and .htaccess in sub directories work just fine.
  3. NiteWave

    NiteWave Administrator

    not true. you can test it easily.

    just to confirm, what's the lsws version?
  4. Monarobase

    Monarobase New Member

    I don't know if this is the normal behaviour but the following should work :

    From my tests when you specify both cache type and cache age litespeed ignores the Cache-Control setting. In litespeed's docs they either set it to max-age=xxx or to private.

    Edit : I don't think the above will work either (at least not on LS 4.2.1) try to update to LS 4.2.2 and see if this helps…
    Last edited: Feb 14, 2013

Share This Page