Caldav 服务器 - 轮询过于频繁

Caldav server - polled too frequently

我有一个群组调度应用程序,可以为成员提供 Caldav 提要。这非常简单 - 根据要求,只需为该成员抓取即将发生的事件,格式化流,returns 它。一些成员使用的设备轮询过于频繁 - 事情不会经常更新 - 所以我比我需要的更频繁地访问我的数据库。

我显然可以缓存格式化的流并且更新它的频率不会比我想要的更频繁。对最近投票的人进行 return 某种 "ask me later" 回应会更容易。有这样的回应吗?如果我只是不 return 一个流,客户端会读取它作为 "there are no events" 响应吗?

谢谢!

您或许应该修复客户端轮询的最初原因 'too frequently'。 'too frequently' 对您来说意味着什么?他们是否发送适当的 etag/sync-token 以便轮询便宜?

无论如何,确实有一个 HTTP 状态:HTTP 503

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.

现在的问题是有多少 HTTP 客户端实际上正确地处理了这个问题,但我确实知道一些 :-)