From 3c17a0e53bad28cc38f2df0828e83a71b2f8e1ac Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 31 Jan 2019 16:29:07 -0700 Subject: [PATCH] Mention caching --- specification/server_server_api.rst | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/specification/server_server_api.rst b/specification/server_server_api.rst index 380fe6174..a2672e927 100644 --- a/specification/server_server_api.rst +++ b/specification/server_server_api.rst @@ -122,12 +122,19 @@ The process overall is as follows: made to the hostname (using port 443 exclusively, ignoring the port provided in the server name). This is done as a plain HTTPS request which follows 30x redirects, being careful to avoid redirect loops. - The schema of the ``/.well-known`` request is later in this section. - If the response is invalid (bad JSON, missing properties, etc), - attempts to connect to the target server are aborted - no connections - should be attempted. If the response is valid, the ``m.server`` property - is parsed as ``[:]`` and processed - as follows: + Responses (successful or otherwise) to the ``/.well-known`` endpoint + should be cached by the requesting server. Servers should respect + the cache control headers present on the response, or use a sensible + default when headers are not present. The recommended sensible default + is 24 hours. Servers should additionally impose a maximum cache time + for responses: 48 hours is recommended. Errors are recommended to be + cached for up to an hour, and servers are encouraged to exponentially + back off for repeated failures. The schema of the ``/.well-known`` + request is later in this section. If the response is invalid (bad JSON, + missing properties, etc), attempts to connect to the target server are + aborted - no connections should be attempted. If the response is valid, + the ``m.server`` property is parsed as ``[:]`` + and processed as follows: * If ```` is an IP literal, then that IP address should be used together with the ```` or 8448 if no