RE: [Zope-dev] Etag support in page templates

2003-11-02 Thread Bjorn Stabell
Just FYI.  Apache 2.0.48 now honors caching of pages which only have
Expires set (no need to include Etag and/or Last-Modified), but the 1.3
team hasn't responded and so 1.3.29 still has the bug.  With mod_deflate
site-wide compression of text/html etc, I guess it's enough candy there
for me to upgrade:)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Etag support in page templates

2003-09-17 Thread Chris Withers
Jens Vagelpohl wrote:
+1

Along with that the MS Author Via header garbage should at least be 
governed by some configuration flag.
+ as many things as I'm allowed ;-)

Then I can finally stop patching production servers that serve up MS office 
files for download...

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Etag support in page templates

2003-09-17 Thread Chris Withers
Jamie Heilman wrote:
  Solution A)
 Solution B)
The correct answer, of course, is to do both...

Sorry, but not everyone fronts Zope with a proxy (yes, of coruse they should 
Jamie, but you have to understand not everyone is qutie as godlike as wants to 
get going as quickly as possible so they can try thing out, not as correctly as 
possible... hence the use case of Zope running standalone on a Win98 laptop ;-)

In addition, some people's proxies may not be capable of adding the required 
headers.

Finally, if support is added back, I'd like to see if via an API, so I can 
configure at the application level what headers are sent and from where.

I wonder if RESPONSE.setHeader() is sufficient for this?

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Etag support in page templates

2003-09-16 Thread Shane Hathaway
Jamie Heilman wrote:
Tres Seaver wrote:

The empty E-tag exists to support *very* broken clients (MSOffice over
WebFolders);  it should be removed, perhaps with a knob which allows
re-enabling it for the sites that actually have people editing content
using those clients.


Yeah it should be removed, but I'd say don't provide any way to add it
back (apart from maybe some textual instructions in the doc directory
or something).  The thing that continues to baffle me is why people add
braindamage like this to Zope at all.
Some controversial checkins have not been discussed beforehand.  I watch 
the checkins, and I see things that I don't like, but I don't pipe up 
unless I consider the checkin dangerous.  I usually give people the 
benefit of the doubt.

In the case of empty Etags, I think that sending an empty header has 
been shown to be the wrong choice.  I suggest it should be removed from 
the head and the 2_7 branch.

For future reference to any committers: if you modify any HTTP headers 
sent by Zope, you very likely ought to discuss it before checking it in.

Shane

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Etag support in page templates

2003-09-16 Thread Jens Vagelpohl

In the case of empty Etags, I think that sending an empty header has 
been shown to be the wrong choice.  I suggest it should be removed 
from the head and the 2_7 branch.

For future reference to any committers: if you modify any HTTP headers 
sent by Zope, you very likely ought to discuss it before checking it 
in.

Shane

+1

Along with that the MS Author Via header garbage should at least be 
governed by some configuration flag.

jens

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Etag support in page templates

2003-09-16 Thread Jamie Heilman
Jens Vagelpohl wrote:
 Along with that the MS Author Via header garbage should at least be 
 governed by some configuration flag.

No, no, no, you're not seeing the bigger picture... you don't need
configuration flags for any of that stuff.  It just shouldn't exist,
period.  If people need to clutter the protocol to make their clients
work then they should do so with another filter program.  In zserver's
case thats going to be the proxy HTTP daemon that it talks to.

-- 
Jamie Heilman http://audible.transient.net/~jamie/
Most people wouldn't know music if it came up and bit them on the ass.
-Frank Zappa

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Etag support in page templates

2003-09-16 Thread Jens Vagelpohl
Jens Vagelpohl wrote:
Along with that the MS Author Via header garbage should at least be
governed by some configuration flag.
No, no, no, you're not seeing the bigger picture... you don't need
configuration flags for any of that stuff.  It just shouldn't exist,
period.  If people need to clutter the protocol to make their clients
work then they should do so with another filter program.  In zserver's
case thats going to be the proxy HTTP daemon that it talks to.


I'm not looking at the big picture. I'm trying to avoid complaints from 
people that for one reason or another use those broken M$ clients.

jens

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Etag support in page templates

2003-09-16 Thread Jamie Heilman
Jens Vagelpohl wrote:
 I'm not looking at the big picture. I'm trying to avoid complaints from 
 people that for one reason or another use those broken M$ clients.

Think about it:

 Solution A)
# Directive: send-empty-etag
#
# Description:
#   Add an empty Etag HTTP header to server responses to placate
#   buggy Microsoft DAV clients.
#
# Default: off
#
# Example:
#
#   send-empty-etag on

# Directive: send-ms-author-via
#
# Description:
#   Add 'MS-Author-Via: DAV' HTTP header to server responses to
#   placate buggy Microsoft DAV clients.
#
# Default: off
#
# Example:
#
#   send-ms-author-via on

add, all the supporting code for this configuration and its
 implementation
add, maintenance of said support code

Result: The users will ask, Why doesn't my Office application
work with Zope?  The zope oracle will respond, It can,
but you have to enable the send-empty-etag and
send-ms-author-via directives in your zope.conf.  The
user will respond, OK, thanks.

 Solution B)
in doc/WebDAV.txt or similar:

Some Microsoft DAV clients are broken and need special coddling to
work with Zope.  In particular, extra headers need to be added to
the HTTP responses.  This can be done by configuring the HTTP
proxy server to include these extra headers during conversations
with known buggy clients.  For example, using Apache's mod_headers:

Headers set MS-Author-Via DAV
Headers set Etag 

add, maintenance of said document

Result: The users will ask, Why doesn't my Office application
work with Zope?  The zope oracle will respond, It can,
but you have to configure your HTTP proxy to overcome
Microsofts buggy DAV implementation, read doc/WebDAV.txt
for more information. The user will respond, OK, thanks.

Now... which of these scenarios do you think is in Zope's best
interest?

-- 
Jamie Heilman http://audible.transient.net/~jamie/
...thats the metaphorical equivalent of flopping your wedding tackle
 into a lion's mouth and flicking his lovespuds with a wet towel, pure
 insanity...   -Rimmer

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Etag support in page templates

2003-09-15 Thread Jamie Heilman
Tres Seaver wrote:
 The empty E-tag exists to support *very* broken clients (MSOffice over
 WebFolders);  it should be removed, perhaps with a knob which allows
 re-enabling it for the sites that actually have people editing content
 using those clients.

Yeah it should be removed, but I'd say don't provide any way to add it
back (apart from maybe some textual instructions in the doc directory
or something).  The thing that continues to baffle me is why people add
braindamage like this to Zope at all.  Its not the correct place to
add dumb workarounds for dumber clients, the correct place is to use
an external program that wraps the clean conversation and inserts this
junk on the fly.  I bet you could do it with apache's mod_headers for
example.  Same story for that MS-Author-Via junk.  Poluting Zope's
source code isn't the right answer.

-- 
Jamie Heilman http://audible.transient.net/~jamie/
You came all this way, without saying squat, and now you're trying
 to tell me a '56 Chevy can beat a '47 Buick in a dead quarter mile?
 I liked you better when you weren't saying squat kid. -Buddy

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


RE: [Zope-dev] Etag support in page templates

2003-09-15 Thread Dieter Maurer
 On Sun, 2003-09-14 at 22:59, Bjorn Stabell wrote:
  Dieter wrote:
   Please read the HTTP 1.1 spec...
   
 Caching requires either an ETag or Last-Modified header.
 For good reasons...
  
  That would explain why it never got fixed, but that's not how I
  understand the RFC: http://www.w3.org/Protocols/rfc2616/rfc2616.html

I reread the HTTP 1.1 spec and you are right.

Section 13.4 allows any successful response to be cached
unless prohibited by a cache-control directive, while
it does not expect caching if there is neither a cache
validator (ETag, Last-Modified) nor an expiration time.


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Etag support in page templates

2003-09-13 Thread Dieter Maurer
Bjorn Stabell wrote at 2003-9-11 14:45 +0800:
  ...
  Also, in most cases, the content of pages doesn't all come from one
  object, so Last-Modfied doesn't really make sense since it should refer
  to the whole page.  I think the problem is with Apache's inability to
  cache content with Expires set, and that Apache should be fixed.

Please read the HTTP 1.1 spec...

  Caching requires either an ETag or Last-Modified header.
  For good reasons...


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Etag support in page templates

2003-09-11 Thread Bjorn Stabell
Janko wrote:
 I think, this is one problem with the current code. There is 
 no defined way to decide, when something is last modified. 
 With CMF-based sites there is a clearly defined property for 
 this. On the other hand all objects have at least a 
 bobobase_modification_time, but this one changes with every 
 ZODB action on the object.
 
 I'm not sure what to do.

Also, in most cases, the content of pages doesn't all come from one
object, so Last-Modfied doesn't really make sense since it should refer
to the whole page.  I think the problem is with Apache's inability to
cache content with Expires set, and that Apache should be fixed.


ETAG NOTES

As for Zope, I'm not sure if setting and empty Etag header is the right
thing to do if no Etag was provided...?

I've been thinking about how Zope could be extended to support HTTP
validators on Etags.  How about this (Page Templates = ZPT or DTML):

- Page Templates are extended with a customizable Etag function/
property.  Could be part of the cachable interface.  You should set this
to return a different etag if, and only if, the content of the page was
different.

- Page Templates are extended to support If-Match and other such
conditionals by calling the customized Etag function and returning 304
Not Modified if the Etag conditions are met (e.g., the calculated etag
is the same as the browser/cache provided etag).

- Upon rendering the top most Page Template the Etag is automatically
calculated and included in the HTTP Headers.

If all objects have an etag (Zope seems to be going in that direction
looking at the WebDAV code), then a simple way to calculate the etag for
a page would be the hash of all the etags for all of the content of that
page added together (string concats).  Another way could be to let the
etag change every X seconds (to simulate the current expires caching
model).

Bye,
-- 
Bjorn

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )