尽量减少 Mac 上的 WebDAV 请求数

Minimize number of WebDAV requests on Mac

我正在编写一个 WebDAV 服务器并遇到了以下问题。 Mac OS X 客户端(Mac 的 Finder、Microsoft Office)生成太多不同的请求。我在 Windows 的 Microsoft Word 中遇到了同样的问题,但是在设置 custom headers:

之后
Ms-Author-Via: DAV

Microsoft Word 开始使用数量有限的请求。就是这样 Microsoft Word 编辑 session 在 Windows(以及 Windows 或 Linux 上使用 LibreOffice):

PROPFIND
GET
LOCK (windows only)
PUT
UNLOCK (windows only)
PROPFIND (linux only)

Mac OS Mac 的 Finder 和 Office 但是会产生很多额外的请求,即:

是否有一些 header 组合可以减少 Mac OS X 中的请求数量?

经过一番研究,遗憾的是,这似乎超出了某些 HTTP headers 的能力范围。这也是一个有点已知的问题,因为 this owncloud issue and this document in the sabre DAV documentation shows. Apple's solution 通过以下命令完全禁用临时文件创建:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

但是,听起来您将不得不满足您无法控制的许多客户的需求,这使得这变得不切实际。 Owncloud 解决了这个问题 mocking successfull LOCK/UNLOCKs for finder, turning these requests essentially into NOPs. A less subtle approach were to forcefully prevent creation of these files in the first place. On a personal note, I feel a mix of Owncloud's approach combined with a .metadata_never_index file 最有希望并且基本上没有不需要的 side-effects。