Description
Describe the problem
eXist's WebDAV article should include documentation about the feature introduced in eXist-db/exist@2c6e455. I'd propose this draft - comments welcome! I'd especially appreciate review of the text by @dizzzz, who created the feature.
WebDAV clients typically display the size of files in a directory or use this information when downloading a resource. While the size of binary files can be easily determined in the file system, this is not so for XML documents stored in eXist-db. This is because exact size of an XML document is dependent on serialization parameters (e.g., indentation), and eXist-db does not store XML documents in a serialized form. Calculating the exact size of a document for a given set of serialization would require serializing it, which could slow down the process of listing the contents of a collection. Thus, by default, eXist-db presents WebDAV clients with an "approximate" size of documents, calculated by multiplying the "page size" by the "number of pages" used to store a document in the database. The approximate size is a good indication of the size of documents, but some WebDAV clients cannot deal with this approximation, causing downloaded resources to be improperly truncated or padded.
Two system variables can be set to change the way the size is calculated. They must be set at eXist-db's startup time. The properties are:
org.exist.webdav.PROPFIND_METHOD_XML_SIZE
org.exist.webdav.GET_METHOD_XML_SIZE
The available values for these properties are:
NULL
(no size reported; fastest)APPROXIMATE
(an approximate size is provided but is not guaranteed to be correct; fast)EXACT
(exact size is reported, by first serializing the document to measure its length; slowest)
The defaults for each property are as follows:
PROPFIND
: By default, thePROPFIND
property is set toAPPROXIMATE
by default. The exception is the macOS Finder WebDAV client, which cannot handle the valuesNULL
orAPPROXIMATE
. Thus, for compatibility, eXist-db checks the user agent string and always sets this property toEXACT
for the macOS Finder.GET
: By default, theGET
property is set toNULL
(and this value works well for macOS).
Screenshots
n/a
Please provide the following
- exist-db version: 6.1.0-SNAPSHOT
- documentation version: 5.4.0