Feature #1209
closedshould be able to disable ETag for static files
Description
When loadbalancing between two servers, the etags generated by the each server do not match when a file is first requested from server 1 and the checked against server 2 (this is not an issue specific to lighttpd, this happens with Apache as well).
In Apache, there is an option to disable or configure the calculation of the Etag value, as far as I can see such an option doesn't exist in lighttpd. I have simply patched the source code in mod_staticfile.c, but I would prefer to have this as an config option.
Files
Updated by Anonymous over 17 years ago
I second his request, for this and other reasons it should be possible to disable etag
Updated by Anonymous over 17 years ago
Attached patch provides a config option
etag.use-inode = "enable" | "disable" (default to "enable") which makes the ETag generation use the inode value or not. For running lighty in a server farm, it is recommended to use etag.use-inode = "disable"
Comments on the patch are appreciated but be gentle since its my first lighty patch
-- yusufg
Updated by Anonymous over 17 years ago
Replying to yusufg@gmail.com:
Attached patch provides a config option
etag.use-inode = "enable" | "disable" (default to "enable") which makes the ETag generation use the inode value or not. For running lighty in a server farm, it is recommended to use etag.use-inode = "disable"Comments on the patch are appreciated but be gentle since its my first lighty patch
Sorry forgot to mention that the patch is relative to 1.4.15
-- yusufg
Updated by Anonymous over 17 years ago
I added another option based on weigon's advice
static-file.etags = "enable" | "disable" which decides whether to have ETag generation or not
-- yusufg
Updated by Anonymous over 17 years ago
Another revision based on advice from weigon. modifies etag_create to use bitmap flags and creates
two more options etag.use-mtime and etag.use-size.
patch-version4 is relative to 1.4.15
-- yusufg
Updated by jan over 17 years ago
- Status changed from New to Fixed
- Resolution set to fixed
patch applied in r1874
Updated by glen over 17 years ago
- Status changed from Fixed to Need Feedback
- Resolution deleted (
fixed)
looks like the "disabled" value is uninitialized, as if i disable etag option i get random values for ETag. note sleep 1 is needed too.
# for a in $(seq 1 10); do wget -S -O /dev/null http://localhost/500.html 2>&1 | grep ETag; sleep 1; done ETag: "-7619505750001792476" ETag: "8428385971843460458" ETag: "4467513548741689585" ETag: "-6359908640125068086" ETag: "-3235648356095079770" ETag: "-5187084305365983648" ETag: "7644173974411994873" ETag: "-4145391447258360639" ETag: "-2544186891902987353" ETag: "7859331811392691821" # lighttpd -f /etc/lighttpd/lighttpd.conf -p|grep etag etag.use-inode = "disable" etag.use-mtime = "enable" etag.use-size = "enable"
i used: .../branches/lighttpd-1.4.x) (revision 1878)
Updated by Anonymous over 17 years ago
Glen, Thanks for the bug report. I can reproduce it but as far as I can tell, I have set etag.use-inode as T_CONFIG_BOOLEAN and initialized it to 1 (in configfile.c) so I can't figure out why the behaviour is seen. Jan, any advice ?
-- yusufg
Updated by darix over 17 years ago
there are 2 options enabled for the etag "backend". can you add an log message that prints out which backend was used for the etag?
Updated by Anonymous over 17 years ago
and with stat cache disabled:
# lighttpd -f /etc/lighttpd/lighttpd.conf -p|grep stat-cache server.stat-cache-engine = "disable" # for a in $(seq 1 10); do wget -S -O /dev/null http://lighttpd/500.html 2>&1 | grep ETag; done ETag: "8428385971843460458" ETag: "-6359908640125068086" ETag: "-5187084305365983648" ETag: "-4145391447258360639" ETag: "7859331811392691821" ETag: "-7915964940039907874" ETag: "7809521096938437145" ETag: "-4080159745028840153" ETag: "3126185585067023604" ETag: "-7211738937683960933"
Updated by darix over 17 years ago
any remaining issues here or can we mark this as done?
Updated by glen over 17 years ago
- Status changed from Need Feedback to Fixed
- Resolution set to fixed
no problems from my side :). closing
Updated by mamo over 17 years ago
- Status changed from Fixed to Need Feedback
- Resolution deleted (
fixed)
the option:
static-file.etags = "disable"
breaks mod_compress as this module uses etag when naming the compressed files
Btw. it will be very nice to get this etag patch in trunk aswell :-)
Updated by darix over 17 years ago
mod_compress is disabled now if no etag is found.
migration to trunk pending
Updated by Anonymous over 17 years ago
Why it's not recognized in 1.4.15?
lighttpd-1.4.15 - a light and fast webserver
Build-Date: Jul 20 2007 23:46:47
service lighttpd restart
2007-08-03 12:25:35: (server.c.872) WARNING: unknown config-key: static-file.etags (ignored)
Updated by stbuehler about 16 years ago
- Status changed from Need Feedback to Fixed
- Resolution set to fixed
Fixed in r2245, see #1442.
Also available in: Atom