Ticket #1209 (reopened enhancement)

Opened 15 months ago

Last modified 13 months ago

should be able to disable ETag for static files

Reported by: alexlehm Owned by: jan
Priority: low Milestone: 1.4.20
Component: core Version: 1.4.15
Severity: minor Keywords: etag mod_staticfile
Cc: Blocked By:
Need User Feedback: no Blocking:

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.

Attachments

patch-try2 (4.8 kB) - added by yusufg@… 15 months ago.
Patch which provides etag.use-inode option
patch-lighty-etag-disable (6.9 kB) - added by yusufg@… 15 months ago.
patch adds "static-file.etags" = "enable" | "disable" to completely disable etag
patch-version4 (8.9 kB) - added by yusufg@… 15 months ago.
adds etag.use-mtime and etag.use-size option

Change History

  Changed 15 months ago by anonymous

I second his request, for this and other reasons it should be possible to disable etag

follow-up: ↓ 3   Changed 15 months ago by yusufg@…

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

Changed 15 months ago by yusufg@…

Patch which provides etag.use-inode option

in reply to: ↑ 2   Changed 15 months ago by yusufg@…

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

Changed 15 months ago by yusufg@…

patch adds "static-file.etags" = "enable" | "disable" to completely disable etag

  Changed 15 months ago by yusufg@…

I added another option based on weigon's advice static-file.etags = "enable" | "disable" which decides whether to have ETag generation or not

Changed 15 months ago by yusufg@…

adds etag.use-mtime and etag.use-size option

  Changed 15 months ago by yusufg@…

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

  Changed 15 months ago by jan

  • status changed from new to closed
  • resolution set to fixed

patch applied in [1874]

  Changed 15 months ago by glen

  • status changed from closed to reopened
  • resolution fixed deleted
  • pending unset

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)

  Changed 14 months ago by yusufg@…

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 ?

  Changed 14 months ago by darix

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?

  Changed 14 months ago by anonymous

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"

  Changed 14 months ago by darix

any remaining issues here or can we mark this as done?

  Changed 14 months ago by glen

  • status changed from reopened to closed
  • resolution set to fixed

no problems from my side :). closing

  Changed 14 months ago by mamo

  • status changed from closed to reopened
  • resolution fixed deleted

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 :-)

  Changed 14 months ago by darix

mod_compress is disabled now if no etag is found.

migration to trunk pending

  Changed 13 months ago by anonymous

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)

  Changed 13 months ago by darix

this is new in 1.4.16

Add/Change #1209 (should be able to disable ETag for static files)

Author



Change Properties
<Author field>
Action
as reopened
 
Note: See TracTickets for help on using tickets.