Project

General

Profile

[Solved] GZIP is only compressing .css, no other static files

Added by ChubbyNinja over 6 years ago

Hey!

I'm using lighttpd 1.4.35 on debian

I've got my lighttpd.conf setup like this:

server.modules = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
        "mod_fastcgi",
        "mod_auth",
        "mod_accesslog",
        "mod_evasive",
        "mod_expire" 
)
compress.allowed-encodings = ("bzip2", "gzip", "deflate")
compress.cache-dir = "/home/http/.cache/" 
compress.filetype = ("text/plain","text/css", "text/xml", "text/javascript", "text/svg", "application/x-javascript", "application/javascript" )

But the only files being compressed is the stylesheet(.css) - this confirms lighttpd has access to the cache directory, but does not explain why jaavascript and svg's are not being cached?

When I check the response headers, content type for javascript is application/javascript, so the last item in the array should trigger compress i think?

Any help is appreciated.


Replies (2)

RE: GZIP is only compressing .css, no other static files - Added by gstrauss over 6 years ago

Please first test with a newer version of lighttpd, e.g. lighttpd 1.4.46. lighttpd 1.4.35 was released over 3 1/2 years ago.

RE: GZIP is only compressing .css, no other static files - Added by gstrauss over 6 years ago

mod_compress in lighttpd 1.4.35 only works on static files. If you are returning those resources from CGI or PHP, then mod_compress will not compress them.

    (1-2/2)