Skip to content

Commit b39ccaf

Browse files
committed
Add docs
1 parent dc5da78 commit b39ccaf

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

packages/s3-store/README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The tus protocol supports optional [extensions][]. Below is a table of the suppo
7979
| ------------------------ | --------------- |
8080
| [Creation][] ||
8181
| [Creation With Upload][] ||
82-
| [Expiration][] | |
82+
| [Expiration][] | |
8383
| [Checksum][] ||
8484
| [Termination][] ||
8585
| [Concatenation][] ||
@@ -88,6 +88,32 @@ The tus protocol supports optional [extensions][]. Below is a table of the suppo
8888

8989
After a multipart upload is aborted, no additional parts can be uploaded using that upload ID. The storage consumed by any previously uploaded parts will be freed. However, if any part uploads are currently in progress, those part uploads might or might not succeed. As a result, it might be necessary to set an [S3 Lifecycle configuration](https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpu-abort-incomplete-mpu-lifecycle-config.html) to abort incomplete multipart uploads.
9090

91+
### Expiration
92+
93+
Unlike other stores, the expiration extension on the S3 store does not need to call [`server.cleanExpiredUploads()`][cleanExpiredUploads].
94+
The store creates a `Tus-Complete` tag for all objects, including `.part` and `.info` files, to indicate whether an upload is finished.
95+
This means you could setup a [lifecyle][] policy to automatically clean them up without a CRON job.
96+
97+
```json
98+
{
99+
"Rules": [
100+
{
101+
"Filter": {
102+
"Tag": {
103+
"Key": "Tus-Complete",
104+
"Value": "false"
105+
}
106+
},
107+
"Expiration": {
108+
"Days": 2
109+
}
110+
}
111+
]
112+
}
113+
```
114+
115+
If you want more granularity, it is still possible to configure a CRON job to call [`server.cleanExpiredUploads()`][cleanExpiredUploads] yourself.
116+
91117
## Examples
92118

93119
### Example: using `credentials` to fetch credentials inside a AWS container
@@ -137,3 +163,5 @@ See [`contributing.md`](https://github.com/tus/tus-node-server/blob/main/.github
137163
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
138164
[termination]: https://tus.io/protocols/resumable-upload.html#termination
139165
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation
166+
[cleanExpiredUploads]: https://github.com/tus/tus-node-server/tree/main/packages/server#servercleanupexpireduploads
167+
[lifecyle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html

0 commit comments

Comments
 (0)