Implement site expiration.

Requires `feature = ["expiration"]`.
This commit is contained in:
Catherine
2026-05-29 00:13:44 +02:00
parent 9113025646
commit a7063e00ef
15 changed files with 225 additions and 42 deletions
+1
View File
@@ -90,6 +90,7 @@ Features
- If the site has no contents after the update is applied, performs the same action as `DELETE`.
* In response to a `DELETE` request, the server unpublishes a site. The URL of the request must be the root URL of the site that is being unpublished. Site data remains stored for an indeterminate period of time, but becomes completely inaccessible.
* If a `Dry-Run: yes` header is provided with a `PUT`, `PATCH`, `DELETE`, or `POST` request, only the authorization checks are run; no destructive updates are made.
* If a `Expires: <timestamp>` header is provided with a `PUT` or `PATCH` request, and the `[limits].allow-expiration` configuration option is enabled, and the site with that name does not exist or is already scheduled to expire enabled, the site is then scheduled to expire at `<timestamp>` (in the HTTP date format, e.g. `Mon, 02 Jan 2006 15:04:05 GMT`). Expired sites are removed by the `git-pages -site-expire` command, which must be scheduled to periorically run for this feature to work.
* All updates to site content are atomic (subject to consistency guarantees of the storage backend). That is, there is an instantaneous moment during an update before which the server will return the old content and after which it will return the new content.
* Files with a certain name, when placed in the root of a site, have special functions:
- [Netlify `_redirects`][_redirects] file can be used to specify HTTP redirect and rewrite rules. The _git-pages_ implementation currently does not support placeholders, query parameters, or conditions, and may differ from Netlify in other minor ways. If you find that a supported `_redirects` file feature does not work the same as on Netlify, please file an issue. (Note that _git-pages_ does not perform URL normalization; `/foo` and `/foo/` are *not* the same, unlike with Netlify.)