synapse/tests/federation
Erik Johnston 59a15da433
Add caching support to media endpoints (#18235)
We do a few things in this PR to better support caching:

1. Change `Cache-Control` header to allow intermediary proxies to cache
media *only* if they revalidate on every request. This means that the
intermediary cache will still send the request to Synapse but with a
`If-None-Match` header, at which point Synapse can check auth and
respond with a 304 and empty content.
2. Add `ETag` response header to all media responses. We hardcode this
to `1` since all media is immutable (beyond being deleted).
3. Check for `If-None-Match` header (after checking for auth), and if it
matches then respond with a 304 and empty body.

---------

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2025-03-13 16:28:19 +00:00
..
transport Optional whitespace support in Authorization (#1350) (#17145) 2024-05-08 13:56:16 +00:00
__init__.py Implementation of server_acls 2018-07-04 19:06:20 +01:00
test_complexity.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_federation_catch_up.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_federation_client.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_federation_devices.py Fix join being denied after being invited over federation (#18075) 2025-01-27 11:21:10 -06:00
test_federation_media.py Add caching support to media endpoints (#18235) 2025-03-13 16:28:19 +00:00
test_federation_out_of_band_membership.py Fix join being denied after being invited over federation (#18075) 2025-01-27 11:21:10 -06:00
test_federation_sender.py Fix up logic for delaying sending read receipts over federation. (#17933) 2024-11-25 18:12:33 +00:00
test_federation_server.py Fix join being denied after being invited over federation (#18075) 2025-01-27 11:21:10 -06:00