Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Enable cache time-based expiry by default #11849

Merged
merged 18 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/11849.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enable cache time-based expiry by default.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be worth mentioning the new configuration options that are available, or otherwise pointing to the relevant section of the sample config for the full details.

This could also be done via our upgrading docs, where we have more room.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would likely still sneak a keyword or two in there: expiry_time will be superseded by expire_caches and cache_entry_ttl.
Helps perk people's ears up and helps if you ever need to do a Ctrl+F for one of the config option names.

6 changes: 3 additions & 3 deletions docs/sample_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -738,10 +738,10 @@ caches:
#get_users_who_share_room_with_user: 2.0

# Controls how long an entry can be in a cache without having been
# accessed before being evicted. Defaults to None, which means
# entries are never evicted based on time.
# accessed before being evicted. Defaults to 30m. Comment out this
# option if you don't want entries to be evicted based on time.
#
#expiry_time: 30m
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
Expand Down
6 changes: 3 additions & 3 deletions synapse/config/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ def generate_config_section(self, **kwargs) -> str:
#get_users_who_share_room_with_user: 2.0

# Controls how long an entry can be in a cache without having been
# accessed before being evicted. Defaults to None, which means
# entries are never evicted based on time.
# accessed before being evicted. Defaults to 30m. Comment out this
# option if you don't want entries to be evicted based on time.
#
#expiry_time: 30m
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
Expand Down