Project

General

Profile

Disabling etags for CSS and JS files

Added by cfd over 15 years ago

Hi,

Is it possible to disable etags on CSS and JS files. I have set the:

static-file.etags = "disable"

This has removed the etags from images, but not css or js files.

Thanks in advanced.

Andrew.


Replies (4)

RE: Disabling etags for CSS and JS files - Added by nitrox over 15 years ago

Does your application handle those requests and adds it to them? Else try with "curl -I <yoursite/file.css", and if that still gives you an etag place a test-file outside your apps directory.

RE: Disabling etags for CSS and JS files - Added by mkalkbrenner about 15 years ago

I see the same strange behavior here using debian lenny. If I set static-file.etags = "disable" images will be delivered without etags but css and js still have etags depending on the client!

If you use YSlow within firebug you get this header including an etag (tested on two different work stations):

Vary    Accept-Encoding
Content-Encoding    gzip
Last-Modified    Thu, 04 Feb 2010 13:26:33 GMT
Etag    "301650687" 
Content-Type    application/javascript
Expires    Tue, 23 Feb 2010 13:50:15 GMT
Cache-Control    max-age=1209600
Accept-Ranges    bytes
Content-Length    17605
Date    Tue, 09 Feb 2010 13:50:15 GMT
Server    lighttpd/1.4.19

Using curl -I http://www.ellviva.de/files/js/73c4dff769dfa89796472679a1b3129f.js you get a different header without etag:

HTTP/1.1 200 OK
Expires: Tue, 23 Feb 2010 13:50:21 GMT
Cache-Control: max-age=1209600
Content-Type: application/javascript
Accept-Ranges: bytes
Last-Modified: Thu, 04 Feb 2010 13:26:33 GMT
Content-Length: 37330
Date: Tue, 09 Feb 2010 13:50:21 GMT
Server: lighttpd/1.4.19

The CSS file is served by lighttpd directly. There's no web application on this server.

Any ideas?

RE: Disabling etags for CSS and JS files - Added by patrickdk about 15 years ago

Try disabling mod_compress

mod_compress always adds etags.

RE: Disabling etags for CSS and JS files - Added by mkalkbrenner about 15 years ago

Thanks for the hint.

But why does mod_compress always add etags?

Using apache (what I don't want to do in this case) I can deflate css and js AND turn off etags.

    (1-4/4)