[solved] htaccess and gzip

Discussion in 'General' started by mrxUx, Nov 1, 2012.

  1. mrxUx

    mrxUx Member

    Hello there, I've a question about how compression works with LSWS, I have it activated and dynamic too, however it looks like it is only compressing php files and nothing else.

    For example if I try to go to http://mysite.com/page.php I'll see the header Content-Encoding gzip , gut if I reach the file http://mysite.com/style.css the header doesn't even appear and of course is not being compressed.

    Is this how it works? do LSWS only compress elements that are being called by a PHP?

    On the compression types I have: text/*

    Also I have tried to tweak .htaccess without success

    <FilesMatch "(\.html\.gz|\.css\.gz)$">
    Header set Content-Encoding "gzip"
    Anyone can bring some light or smack me? :)
    Last edited by a moderator: Nov 7, 2012
  2. NiteWave

    NiteWave Administrator

    gzip settings at
    lsws admin console->Server->Tuning->GZIP Compression

    for example, there is an option:
    Min Static File Size (bytes):default is 300

    mean if file size of .css etc less than 300 bytes, then no gzip.
  3. mrxUx

    mrxUx Member

    Oh I was aware of that :) the style I'm trying to reach is about 88K so it should be compressed, the min and max values are 300B / 1M so I'm still unsure what could be this issue, thanks for the quick response NiteWave.
  4. NiteWave

    NiteWave Administrator

    by default, .css/.js is compressed, you needn't configure anything.
    you can check this support forum with firebug, it's running litespeed.
  5. mrxUx

    mrxUx Member

    @NiteWave: Yeah I've done that test too and it is not being gzipped, I can PM you the URL if you want to confirm :) thanks.
  6. webizen

    webizen Well-Known Member

    Post your settings for
    If Auto Update Static is set to Yes, check Static GZIP Cache Directory (default to swap directory /tmp/lshttpd/swap if Static GZIP Cache Directory field is empty) and make sure it is writeable by web server user _and_ it is not full.
    Last edited: Nov 6, 2012
  7. mrxUx

    mrxUx Member

    @webizen: thanks, it is not activated :)
  8. webizen

    webizen Well-Known Member


    Auto Update Static => Yes
  9. mrxUx

    mrxUx Member

    Oh my bad, Auto update static was activated and it is saving now on the Swap directory, I got a little confused about the static gzip cache directory which is pretty much by default swap dir unless specified.

    Thanks for your help guys, you really rock :)

Share This Page