2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-11-09 22:14:59 +00:00

Add media proxy documentation

This commit is contained in:
asonix 2023-12-08 22:47:56 -06:00
parent a087ae7372
commit b36ecfcaf2

View file

@ -114,6 +114,34 @@ It is possible to migrate to postgres after first upgrading to 0.5. This is also
### Media Proxy
pict-rs 0.5 supports caching media, and purging cached media after it is no longer necessary to
keep. This behavior is accessed with pict-rs' new `proxy` query parameter at the `/image/original`
endpoint, and the `/image/process.{ext}` endpoint. By passing the URL to an image to the `proxy`
parameter, you can instruct pict-rs to download the media from that URL and cache it locally before
serving it, or a processed version of it. The proxied media is stored for a configurable time limit,
which resets on each access to the proxied media.
This value can be configured as follows
In the configuration file
```toml
[media.retention]
proxy = "7d" # units available are "m" for minutes, "h" for hours, "d" for days, and "y" for years
```
With environment variables
```bash
PICTRS__MEDIA__RETENTION__PROXY=7d
```
On the commandline
```bash
pict-rs run --media-retention-proxy 7d
```
More documentation can be found in the [pict-rs readme](https://git.asonix.dog/asonix/pict-rs#api)
and in the example [pict-rs.toml](https://git.asonix.dog/asonix/pict-rs/src/branch/main/pict-rs.toml).
### Improved Animation Support