I have an application for group scheduling that serves a Caldav feed to members. It's very simple - on request, just grabs upcoming events for that member, formats the stream, returns it. Some members are using devices that poll much too frequently - things don't update that often - so I'm hitting my database more often than I need to.
I can obviously cache the formatted stream and just update it no more frequently than I feel like it. It would be easier to return some kind of "ask me later" response to someone who has polled recently. Is there such a response? If I just don't return a stream, will the client read that as a "there are no events" response?
thanks!
You should probably fix the original reason why clients are polling 'too frequently'. What does 'too frequently' mean for you? Do they send a proper etag/sync-token so that the polling is cheap?
Regardless, there is indeed an HTTP status for that: 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.
Now the question is how many HTTP clients actually deal with that properly, but I do know some which do :-)