Posted by dropchew on May 3, 2009 at 3:51am
3 followers
Jump to:
| Project: | CSS Gzip |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
Hi,
Has anyone tested it on lighttpd?
Comments
#1
AFAIK it hasn't been tested on lighttpd. Here are the rules fully explained.
This tells the browser that all
css.gzfiles are gzipped and adds a mime type of text/css to css.gz files.<FilesMatch "\.(css.gz)$">AddEncoding x-gzip .gz
ForceType text/css
</FilesMatch>
In lighttpd this line (
ForceType text/css) would be something like this?mimetype.assign = ( ".css.gz" => "text/css")I have no idea how to do (
AddEncoding x-gzip .gz) after reading the docs.The next one is the rewrite rules. IF NOT Safari && accepts gzip encoding && yourcssfile.css.gz exists THEN rewrite
*.cssto*.css.gz.RewriteCond %{HTTP_USER_AGENT} !.*Safari.*RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)\.css $1.css.gz [L,QSA]
In lighttpd the last line would be?
url.rewrite-once = ( "^(.*)\.css" => "$1.css.gz" )I have no idea how to do conditionals in lighttpd from the docs.
As of right now, lighttpd is unsupported. But if someone comes up with some rules, then I would be willing add it in.
#2
This module is not need on lighttpd. Reading the documentation, I've put these lines on my
lighttpd.confserver.modules += ( "mod_compress" )compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ("text/css", "text/javascript")
I also created the folder
/var/cache/lighttpd/compressand chowned it to the lighttpd user and group as configured on my Arch Linux, for Debian/Ubuntu the user and group ids should both be www-data.chown http:http /var/cache/lighttpd/compressNow, every css ou javascript served is compressed and cached on
/var/cache/lighttpd/compress, the only con I've found is that lighttpd doesn't exclude old compressed files.Sorry for my poor English
#3
Does the compressed dir have a ba-zillion files in there? Apache will generate a different file for each HTTP_USER_AGENT (from what I hear) so thats why caching it via apache doesn't work so well.
#4
Due to recent developments with the boost module; I sorta know how lighttpd works. I can use this as a guide
http://groups.drupal.org/node/22787
#5
CSS Gzip will no longer be updated/supported. All future development is being done in the Advanced CSS/JS Aggregation module.