RE: [Zope-dev] Etag support in page templates
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 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21 http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.2 Indicates that "Expires" is enough to make content cacheable, and that it should be considered "fresh" until its expire time unless clients or servers use cache-control headers to force a revalidation. Last-Modified and Etag are used to validate the content after it expires using If-Modified-Since and If-None-Match respectively. Is there a thread discussing this already somewhere? [ Btw, Zope does return an empty Etag header; does that cause any confusion? ] Bye, -- Bjorn
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
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21 http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.2 Indicates that "Expires" is enough to make content cacheable, and that it should be considered "fresh" until its expire time unless clients or servers use cache-control headers to force a revalidation.
Last-Modified and Etag are used to validate the content after it expires using If-Modified-Since and If-None-Match respectively.
Is there a thread discussing this already somewhere?
[ Btw, Zope does return an empty Etag header; does that cause any confusion? ]
I have a report that it does, at least for one hardware-based cache; I added a feature to z2.py for a client to turn this off. 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. A proposal to allow setting the header in a more useful way would be welcome. Tres. -- =============================================================== Tres Seaver tseaver@zope.com Zope Corporation "Zope Dealers" http://www.zope.com
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
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
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
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
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
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
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
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
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
participants (7)
-
Bjorn Stabell -
Chris Withers -
Dieter Maurer -
Jamie Heilman -
Jens Vagelpohl -
Shane Hathaway -
Tres Seaver