summary refs log tree commit diff
path: root/synapse/config/cache.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2021-08-03 14:45:04 +0100
committerGitHub <noreply@github.com>2021-08-03 14:45:04 +0100
commit4b10880da363efed5d066191190237f1c64fddfd (patch)
tree4218a9f817ec47f000d31fad5c30ba7145e27d0e /synapse/config/cache.py
parentInclude room ID in ignored EDU log messages (#10507) (diff)
downloadsynapse-4b10880da363efed5d066191190237f1c64fddfd.tar.xz
Make sync response cache time configurable. (#10513)
Diffstat (limited to 'synapse/config/cache.py')
-rw-r--r--synapse/config/cache.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/config/cache.py b/synapse/config/cache.py
index 8d5f38b5d9..d119427ad8 100644
--- a/synapse/config/cache.py
+++ b/synapse/config/cache.py
@@ -151,6 +151,15 @@ class CacheConfig(Config):
           # entries are never evicted based on time.
           #
           #expiry_time: 30m
+
+          # Controls how long the results of a /sync request are cached for after
+          # a successful response is returned. A higher duration can help clients with
+          # intermittent connections, at the cost of higher memory usage.
+          #
+          # By default, this is zero, which means that sync responses are not cached
+          # at all.
+          #
+          #sync_response_cache_duration: 2m
         """
 
     def read_config(self, config, **kwargs):
@@ -212,6 +221,10 @@ class CacheConfig(Config):
         else:
             self.expiry_time_msec = None
 
+        self.sync_response_cache_duration = self.parse_duration(
+            cache_config.get("sync_response_cache_duration", 0)
+        )
+
         # Resize all caches (if necessary) with the new factors we've loaded
         self.resize_all_caches()