lighttpd mod_deflate

Bug #1995758 reported by sascha arthur
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lighttpd (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Hello,

Im using lighttpd in combination with mod_deflate to reduce traffic load.

using this config here:

server.modules += ("mod_deflate")

# new deflate:
deflate.mimetypes = ("text/")
deflate.allowed-encodings = ( "br", "gzip", "deflate")
deflate.cache-dir = "/var/cache/lighttpd/compress"
cache.disk.etag = "/var/cache/lighttpd/compress/cache_etag"
deflate.max-compress-size = 131072
deflate.min-compress-size = 0

deflate.params = (
  "BROTLI_PARAM_QUALITY" => 7,
  "BROTLI_PARAM_LGWIN" => 22,
  "BROTLI_PARAM_MODE" => 0,
  "ZSTD_c_compressionLevel" => 22,
  "gzip.level" => 9,
  "gzip.memLevel" => 9,
  "gzip.strategy" => 0,
)

- etag header is set and enabled by etag.use-size = "enable".
- Cache-Control header is on "public".
- Config doesnt complain about errors,
- mime types are correctly mapped by using include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

But the cache in /var/cache/lighttpd/compress is never containing any files .. Any ideas?

Revision history for this message
gstrauss (gstrauss) wrote :

> cache.disk.etag = "/var/cache/lighttpd/compress/cache_etag"

What is that? Where did it come from? Perhaps some third-party module?
That directive does not exist in the official lighttpd source upstream.

If things are not working for you, you should remove *all* optional settings and focus on getting things working before adding tuning settings. These are all optional and you should probably prefer the lighttpd defaults:
```
deflate.max-compress-size = 131072
deflate.min-compress-size = 0

deflate.params = (
  "BROTLI_PARAM_QUALITY" => 7,
  "BROTLI_PARAM_LGWIN" => 22,
  "BROTLI_PARAM_MODE" => 0,
  "ZSTD_c_compressionLevel" => 22,
  "gzip.level" => 9,
  "gzip.memLevel" => 9,
  "gzip.strategy" => 0,
)
```

Did you check that `deflate.cache-dir = "/var/cache/lighttpd/compress"` the directory exists and lighttpd has write permission?

Did you test by accessing a simple static file (with mimetype text/*) to see if the cache is filled? Have you checked that you are receiving a compressed response to your test HTTP request, even if the cache is not filled? If you're not receiving a compressed response to your test HTTP request, then mod_deflate is not handling the request for the static file.

Did you read through https://wiki.lighttpd.net/Docs_ModDeflate and check the Known Limitations section?

> - etag header is set and enabled by etag.use-size = "enable".

You should prefer to use lighttpd defaults unless you have read the lighttpd documentation for etags and really want to change it.

I also do not understand why this is not a forum post asking for assistance. This is unlikely to be a bug in lighttpd.

Revision history for this message
sascha arthur (sarthur) wrote :

in my case it was ordering.

mod_setenv was included before mod_deflate, which broke the caching thing.

will close the ticket.

Changed in lighttpd (Ubuntu):
status: New → Invalid
Revision history for this message
gstrauss (gstrauss) wrote :

mod_setenv before mod_deflate is not a problem by itself.

You're very likely doing something questionable and wrong with setenv.

Continuing to do that questionable and wrong thing after mod_deflate handles the response might produce an invalid or broken HTTP response, which might be broken in subtle ways, such as causing invalid caching by proxies and incorrect results being returned to requests from *some* clients.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers