getcontentlength property and dynamically-generated content

I have an interesting situation and I'm hoping someone can offer a little advice.

I'm writing a WEBDAV server that serves out of an object database (which is just a hierarchial tree of objects). Objects can't be transmitted directly from the database; they have to be serialized so that they can be transferred over HTTP. When serving a GET request, the object is serialized and then finding its Content-Length is easy.

However, when serving a HEAD or PROPFIND request, there is no way to find the length without serializing the object (which can be a time-consuming process if the object is large). It seems like a waste of effort to serialize an object only to find its length.

As I understand the spec, my server should either send a Content-Length header for GET and HEAD methods and the getcontentlength property for PROPFINDs, or not at all. This is more strict than I would like.

Is there a way around this that I don't see? Should I just pay the penalty, or should the spec be modified to support only sending the content length when it is not wasteful to compute it?

Wesley Felter - wesley@scripting.com

Received on Wednesday, 25 March 1998 02:03:45 UTC