matrix-public-archive/server/lib
Eric Eastwood 9b067f8637
Set `X-Date-Temporal-Context` header for easy cache rules (#209)
Set `X-Date-Temporal-Context: [past|present|future]` header for easy cache rules:

 - Cache `past` things heavily
 - Cache `present`/`future` things for 5 minutes
 
This accomplishes the goal we set out for:

> - We can cache all responses except for the latest UTC day (and anything in the future). ex. `/!aMzLHLvScQCGKDNqCB:gitter.im/date/2022/10/13`
>    - For the latest day, we could set the cache expire after 5 minutes or so
>
> *-- [Matrix Public Archive deployment issue](https://github.com/vector-im/sre-internal/issues/2079)*

And this way we don't have to do any fancy date parsing and comparison from the URL which is probably not even possible Cloudflare cache rules.
2023-05-04 13:42:59 -05:00
..
errors Timeout requests and stop processing further (#204) 2023-05-02 00:39:01 -05:00
matrix-utils Timeout requests and stop processing further (#204) 2023-05-02 00:39:01 -05:00
config.js Use JSON5 for configuration files with comments (#52) 2022-08-29 20:33:02 -05:00
express-async-handler.js Fix lints 2022-02-15 21:33:31 -06:00
fetch-endpoint.js Timeout requests and stop processing further (#204) 2023-05-02 00:39:01 -05:00
get-dependencies-for-entry-point-name.js Cache derived info from the `manifest.json` (#191) 2023-04-26 17:04:49 -05:00
get-favicon-asset-urls.js Cache derived info from the `manifest.json` (#191) 2023-04-26 17:04:49 -05:00
get-version-tags.js Production ready build (#175) 2023-04-24 23:50:53 -05:00
parse-via-servers-from-user-input.js Timeout requests and stop processing further (#204) 2023-05-02 00:39:01 -05:00
safe-json.js OpenTelemetry tracing so we can see spans where the app is taking time (#27) 2022-07-14 11:08:50 -05:00
sanitize-html.js OpenTelemetry tracing so we can see spans where the app is taking time (#27) 2022-07-14 11:08:50 -05:00
set-headers-for-date-temporal-context.js Set `X-Date-Temporal-Context` header for easy cache rules (#209) 2023-05-04 13:42:59 -05:00
set-headers-to-preload-assets.js Set `X-Date-Temporal-Context` header for easy cache rules (#209) 2023-05-04 13:42:59 -05:00