conduwuit/src/api/client_server
Benjamin Lee 8bffcfe82b remove sync response cache
This cache can serve invalid responses, and has an extremely low hit
rate.

It serves invalid responses because because it's only keyed off
the `since` parameter, but many of the other request parameters also
affect the response or it's side effects. This will become worse once we
implement filtering, because there will be a wider space of parameters
with different responses. This problem is fixable, but not worth it
because of the low hit rate.

The low hit rate is because normal clients will always issue the next
sync request with `since` set to the `prev_batch` value of the previous
response. The only time we expect to see multiple requests with the same
`since` is when the response is empty, but we don't cache empty
responses.

This was confirmed experimentally by logging cache hits and misses over
15 minutes with a wide variety of clients. This test was run on
matrix.computer.surgery, which has only a few active users, but a
large volume of sync traffic from many rooms. Over the test period, we
had 3 hits and 5309 misses. All hits occurred in the first minute, so I
suspect that they had something to do with client recovery from an
offline state. The clients that were connected during the test are:

 - element web
 - schildichat web
 - iamb
 - gomuks
 - nheko
 - fractal
 - fluffychat web
 - fluffychat android
 - cinny web
 - element android
 - element X android

Fixes: #336
2024-05-17 18:13:11 -04:00
..
account.rs config option to auto-remediate bad users joining bad rooms or servers 2024-05-09 17:44:15 -04:00
alias.rs Fix appservice namespace check for room aliases 2024-05-06 03:45:10 -04:00
backup.rs resolve almost all as_conversions lints 2024-05-06 03:45:10 -04:00
capabilities.rs initialise capabilities with default constructor 2024-05-03 01:52:29 -04:00
config.rs dedupe half of account/room data config.rs code 2024-05-03 01:52:29 -04:00
context.rs resolve almost all as_conversions lints 2024-05-06 03:45:10 -04:00
device.rs make everything pub(crate) instead of pub 2024-04-26 02:03:40 -04:00
directory.rs resolve almost all as_conversions lints 2024-05-06 03:45:10 -04:00
filter.rs make everything pub(crate) instead of pub 2024-04-26 02:03:40 -04:00
keys.rs correct arithmetic adjustments 2024-05-06 03:45:10 -04:00
media.rs media: return our detected MIME type for Content-Type 2024-05-12 15:54:22 -04:00
membership.rs Revert "feat(membership): check if user already has the membership that is requested to be set" 2024-05-10 22:52:44 -04:00
message.rs resolve almost all as_conversions lints 2024-05-06 03:45:10 -04:00
mod.rs make everything pub(crate) instead of pub 2024-04-26 02:03:40 -04:00
presence.rs presence: set empty string status msg to None 2024-05-06 03:45:10 -04:00
profile.rs use user_is_local and server_is_ours more, remove few double filters 2024-05-03 01:52:29 -04:00
push.rs make everything pub(crate) instead of pub 2024-04-26 02:03:40 -04:00
read_marker.rs make everything pub(crate) instead of pub 2024-04-26 02:03:40 -04:00
redact.rs make everything pub(crate) instead of pub 2024-04-26 02:03:40 -04:00
relations.rs make everything pub(crate) instead of pub 2024-04-26 02:03:40 -04:00
report.rs fix broken reports 2024-05-09 12:33:46 -04:00
room.rs correct arithmetic adjustments 2024-05-06 03:45:10 -04:00
search.rs make next_batch token a variable in search, revert threads_until change 2024-05-06 03:45:10 -04:00
session.rs remove namespace check on username login, code simplification on login route 2024-05-15 14:31:35 -04:00
space.rs resolve almost all as_conversions lints 2024-05-06 03:45:10 -04:00
state.rs dedupe some code in state.rs 2024-05-03 01:52:29 -04:00
sync.rs remove sync response cache 2024-05-17 18:13:11 -04:00
tag.rs make everything pub(crate) instead of pub 2024-04-26 02:03:40 -04:00
thirdparty.rs make everything pub(crate) instead of pub 2024-04-26 02:03:40 -04:00
threads.rs resolve almost all as_conversions lints 2024-05-06 03:45:10 -04:00
to_device.rs use user_is_local and server_is_ours more, remove few double filters 2024-05-03 01:52:29 -04:00
typing.rs resolve half of the integer_arithmetic lints, couple misc changes 2024-05-06 03:45:10 -04:00
unstable.rs make everything pub(crate) instead of pub 2024-04-26 02:03:40 -04:00
unversioned.rs dedupe version getting code, rename to CONDUWUIT_VERSION_EXTRA 2024-05-03 01:52:29 -04:00
user_directory.rs resolve almost all as_conversions lints 2024-05-06 03:45:10 -04:00
voip.rs resolve half of the integer_arithmetic lints, couple misc changes 2024-05-06 03:45:10 -04:00