LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Feedback/Feature Requests > ETag

Reply
 
Thread Tools Display Modes
  #1  
Old 07-12-2006, 11:05 AM
jailbird jailbird is offline
Member
 
Join Date: Oct 2004
Posts: 23
Default ETag

I was just curious if there's a reason LSWS doesn't generate ETag headers for dynamic content (eg, PHP output via LSAPI).

ETag is basically the only use I have left for cgi_buffer, and I'd like to just get rid of cgi_buffer completely .
Reply With Quote
  #2  
Old 07-12-2006, 11:11 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
If you want ETag header, you can generated it from PHP side.
Reply With Quote
  #3  
Old 07-12-2006, 12:13 PM
jailbird jailbird is offline
Member
 
Join Date: Oct 2004
Posts: 23
Quote:
Originally Posted by mistwang
If you want ETag header, you can generated it from PHP side.
Ya, that's basically what I was using cgi_buffer. Was just curious since you have gzip support for dynamic content and ETag support for static content, if there was a reason you don't do ETag for dynamic . It seems like it would be cleaner to keep that in the server instead of having to do it in all of the backends (PHP, Ruby, perl, FastCGI, etc).

Thanks for the reply.
Reply With Quote
  #4  
Old 07-12-2006, 12:51 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Maybe we will add it when we implementing the disk cache.
Calculating something like MD5 checksum for each every dynamic request is pretty expensive though. Any other idea for ETag calcuation? cgi_buffer uses MD5

Last edited by mistwang; 07-12-2006 at 12:57 PM..
Reply With Quote
  #5  
Old 07-12-2006, 12:56 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
And there is annother issue with generating ETag dynamically, web server have to wait till the last byte of response body before it can start sending response back to client.
Reply With Quote
  #6  
Old 07-13-2006, 05:03 AM
Nope Nope is offline
Member
 
Join Date: Mar 2005
Location: Germany/Bavaria
Posts: 11
What's the use of an ETag for dynamic content generated outside its application?

For example I use etags within my forum project. There I create the etag on the fly based on the board_id+topic_id+page+highrestimer(of the last change in the database). This is done prior to anything else. If that plus the user_id matches against the one given with the request I can leave the app asap. If not I use the current etag to check the request against the forum's build in cache, so re-building the whole content can be avoided. Only if that fails, the base page is build, then the user specific things added.

The server on the other hand knows nothing like that. It can only check the data the application is sending. To create something like a checksum from that beats the benefits of an etag to dust. Besides, if the data is user specific or if it's created based on the query string or a post, it's not cacheable, making the whole thing more than useless. If the content is created time specific, then a normal expires will do just fine. If it's just a redirected static file, then there should be no problem either.

So basically I can't see much benefit of an etag for dynamic content without the app itself managing it.
Reply With Quote
  #7  
Old 07-13-2006, 07:15 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
I agree, ETag generation should be application specific, otherwise, it is not that useful and wasting precious CPU cycles. :-)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Etag generation customization bazza Install/Configuration 6 07-30-2008 10:31 PM


All times are GMT -7. The time now is 04:15 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.