mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-22 11:21:24 +00:00
Add media proxy documentation
This commit is contained in:
parent
a087ae7372
commit
b36ecfcaf2
1 changed files with 28 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue