You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Geoff Millikan <gm...@t1shopper.com> on 2010/01/05 20:13:17 UTC

[users@httpd] ETag (entity tag) response header not being added to server side include's

Dear List,

Our ETag response header is being added successfully on all responses except
those files containing server side includes.  For example:

ETag is being set:
http://www.t1shopper.com/1KB.html

Etag not set:
http://www.t1shopper.com/index.shtml

The shtml files are using virtual includes like this:
<!--#include virtual="/ssi/footer-master.shtml" -->

How can I get Etag response header to show up on shtml files?

Best Regards,
 
Geoff Millikan
Newbury Park, CA, USA 91320
http://www.t1shopper.com/

---== httpd.conf Apache 2.2.3 (RedHat5) ==---
FileETag All
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

--== Headers ==--
http://www.t1shopper.com/1KB.html
HTTP/1.x 200 OK
Date: Tue, 05 Jan 2010 19:01:40 GMT
Server: Apache
Last-Modified: Wed, 02 Jul 2008 23:12:50 GMT
Etag: "16904da-45112a1a44080"
Accept-Ranges: bytes
Cache-Control: max-age=15552000
Expires: Sun, 04 Jul 2010 19:01:21 GMT
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 41
Age: 19
Keep-Alive: timeout=3, max=100
Connection: Keep-Alive
Content-Type: text/html

http://www.t1shopper.com/index.shtml
HTTP/1.x 200 OK
Date: Tue, 05 Jan 2010 19:02:33 GMT
Server: Apache
Accept-Ranges: bytes
Cache-Control: max-age=15552000
Expires: Sun, 04 Jul 2010 19:02:33 GMT
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 7523
Keep-Alive: timeout=3, max=100
Connection: Keep-Alive
Content-Type: text/html

This couldn't possibly be a bug as Etag support started in 1.3.23 and SSI
before that!


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] ETag (entity tag) response header not being added to server side include's

Posted by Geoff Millikan <gm...@t1shopper.com>.
Thanks.  Apache 2.2 rocks and it's still rocking the free world after 15
years this February.  Here's to another 15 years - keep up the good work
Apache Project!

Re: [users@httpd] ETag (entity tag) response header not being added to server side include's

Posted by Eric Covener <co...@gmail.com>.
On Tue, Jan 5, 2010 at 8:03 PM, Geoff Millikan <gm...@t1shopper.com> wrote:
>> [The Apache documentation] should more clearly state that
>> it generates ETags for static files only. The resource in
>> question is not really a static file.
>
> I imagine there's nothing I can do to help get the 2.2 docs updated but if
> there is, I'm happy to help.

I updated the FileEtag documentation (shift-refresh on
http://httpd.apache.org/docs/2.2/mod/core.html#fileetag)



-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] ETag (entity tag) response header not being added to server side include's

Posted by Geoff Millikan <gm...@t1shopper.com>.
> [The Apache documentation] should more clearly state that 
> it generates ETags for static files only. The resource in 
> question is not really a static file.

I imagine there's nothing I can do to help get the 2.2 docs updated but if
there is, I'm happy to help.
 
> The cache doesn't know the full contents of the response until it's
> all been written to the client via the output filters.  You can't
> calculate headers at the end of a response and still use them.

I understand the full contents of the item (and its headers) cannot be known
until it's cached - but then once cached, everything is known, headers
included I believe?  This implies items served from cache could have an Etag
merged or  appended to the already-known headers.  Regardless, Apache
doesn't offer a way to add an Etag to dynamic content today.  Rats.  

Thanks,

Geoff

PS. The digest at http://httpd.markmail.org/search/?q=etag shows half a
dozen people trying to write custom applications to do this.  Now if the
HTTP Project takes it on then the world saves untold CPU cycles/bandwidth or
maybe even bringing global peace.  For that, I'll put up a couple hundred
bucks up to see the feature added - anyone on Apace dev reading this, just
let me know when it's in trunk and just email me your PayPal info. Or let me
know what beer you like - I'm good for a case shipped anywhere in the USA.

PPS. BTW Apache rocks.  We indorse it publically so keep up the good work!
http://www.t1shopper.com/businesspartners.shtml#apache

Re: [users@httpd] ETag (entity tag) response header not being added to server side include's

Posted by Eric Covener <co...@gmail.com>.
On Tue, Jan 5, 2010 at 5:50 PM, Geoff Millikan <gm...@t1shopper.com> wrote:
>> I think this is a long-standing limitation, since the etag can't be
>> easily precomputed for the overall response (all the included stuff
>> smushed together from potential exec's, etc)
>
> I understand however the FileETag documentation doesn't even *hint* at such
> a limitation.

It should more clearly state that it generates ETags for static files
only. The resource in question is not really a static file.

> By comparison, mod_disk_cache has no problem reading all the SSI stuff
> together and then caching the page (as long as "include virtual" is used).
> I think if mod_disk_cache can do it then so can FileETag.

The cache doesn't know the full contents of the response until it's
all been written to the client via the output filters.  You can't
calculate headers at the end of a response and still use them.

> (For that matter,
> FileETag could generate its Etag off the cached document!)

It's not a file.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] ETag (entity tag) response header not being added to server side include's

Posted by Geoff Millikan <gm...@t1shopper.com>.
> I think this is a long-standing limitation, since the etag can't be
> easily precomputed for the overall response (all the included stuff
> smushed together from potential exec's, etc)

I understand however the FileETag documentation doesn't even *hint* at such
a limitation.

By comparison, mod_disk_cache has no problem reading all the SSI stuff
together and then caching the page (as long as "include virtual" is used).
I think if mod_disk_cache can do it then so can FileETag. (For that matter,
FileETag could generate its Etag off the cached document!)

http://httpd.apache.org/docs/2.2/caching.html#overview

http://httpd.apache.org/docs/2.2/mod/core.html#fileetag

Re: [users@httpd] ETag (entity tag) response header not being added to server side include's

Posted by Eric Covener <co...@gmail.com>.
On Tue, Jan 5, 2010 at 2:13 PM, Geoff Millikan <gm...@t1shopper.com> wrote:
> Dear List,
>
> Our ETag response header is being added successfully on all responses except
> those files containing server side includes.  For example:
>
> ETag is being set:
> http://www.t1shopper.com/1KB.html
>
> Etag not set:
> http://www.t1shopper.com/index.shtml
>
> The shtml files are using virtual includes like this:
> <!--#include virtual="/ssi/footer-master.shtml" -->
>
> How can I get Etag response header to show up on shtml files?

I think this is a long-standing limitation, since the etag can't be
easily precomputed for the overall response (all the included stuff
smushed together from potential exec's, etc)

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org