Skip to content

Commit 038d56d

Browse files
committed
More links
1 parent 6de0864 commit 038d56d

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ included as a part of [Handler](./workers/handler/) in order to ensure that the
6161
[Watcher](./workers/watcher/).
6262

6363
The [worker](https://developers.cloudflare.com/workers/) also exposes a `/purge` endpoint that allows tags to be purged.
64-
This endpoint matches the [interface of the Cloudflare endpoint](https://developers.cloudflare.com/api/operations/zone-purge#purge-cached-content-by-tag-host-or-prefix), but only allows `tags`. If no
65-
[zone](https://developers.cloudflare.com/fundamentals/setup/accounts-and-zones/#zones) information is provided
66-
(via the [CF-Worker](https://developers.cloudflare.com/fundamentals/reference/http-request-headers/#cf-worker) header),
67-
matching resources from **all** zones will be purged.
64+
This endpoint matches the
65+
[interface of the Cloudflare endpoint](https://developers.cloudflare.com/api/operations/zone-purge#purge-cached-content-by-tag-host-or-prefix), but only allows `tags`. If no
66+
[zone](https://developers.cloudflare.com/fundamentals/setup/accounts-and-zones/#zones) information is provided (via the
67+
[CF-Worker](https://developers.cloudflare.com/fundamentals/reference/http-request-headers/#cf-worker) header), matching
68+
resources from **all** zones will be purged.
6869

6970
After receiving and validating requests to either the `/capture` or `/purge` endpoints, the
7071
[worker](https://developers.cloudflare.com/workers/) adds the requests to the `cache-capture` and `cache-purge-tag`
@@ -80,26 +81,27 @@ tags are stored in the [D1](https://developers.cloudflare.com/d1/) database.
8081
A message received from [Controller](./workers/controller/) in the `cache-purge-tag` queue results in the URLs being
8182
looked up in the [D1](https://developers.cloudflare.com/d1/) database from the provided tag, and re-queing those URLs by
8283
adding each one to the `cache-purge-url` queue. Since this will result in the resource being eventually removed from the
83-
cache, the URL and all tags associated with it are removed from the [D1](https://developers.cloudflare.com/d1/) database.
84+
cache, the URL and all tags associated with it are removed from the [D1](https://developers.cloudflare.com/d1/)
85+
database.
8486

8587
Finally, when a message is received from the `cache-purge-url` queue, the URLs are
8688
[purged with Cloudflare's API](https://developers.cloudflare.com/api/operations/zone-purge#purge-cached-content-by-url).
8789

8890
## Usage
8991

9092
I am not aware of a good way to distribute this application for use on your own other than forking it and modifying it.
91-
It is [licensed under the AGPL-3.0 license](./LICENSE.md) so you are free to modify it under the temrs of that license.
92-
I thought about using Terraform in order to make it easier for others to deploy on their own, but it seemed like
93-
overkill for my purposes. I'm happy to accept PRs that make life easier.
93+
It is [licensed under the AGPL-3.0 license](./LICENSE.md) so you are free to modify it under the terms of that license.
94+
I thought about using [Terraform](https://www.terraform.io/) in order to make it easier for others to deploy on their
95+
own, but it seemed like overkill for my purposes. I'm happy to accept PRs that make life easier.
9496

9597
## Authentication
9698

9799
I chose to use the `API_TOKEN` [secret](https://developers.cloudflare.com/workers/configuration/secrets/) for
98100
authentication/authorization to the [Controller](./workers/controller/) and to use the same token to make requests to
99-
the [Cloudflare API](https://developers.cloudflare.com/api/). This simplified the approach by only having to have a single secret in the worker and sharing that
100-
secret with the Origin server. This allows the origin to make requests to the
101-
[Cloudflare API](https://developers.cloudflare.com/api/) or the [Worker](https://developers.cloudflare.com/workers/)
102-
seamlessly.
101+
the [Cloudflare API](https://developers.cloudflare.com/api/). This simplified the approach by only having to have a
102+
single secret in the worker and sharing that secret with the Origin server. This allows the origin to make requests to
103+
the [Cloudflare API](https://developers.cloudflare.com/api/) or the
104+
[Worker](https://developers.cloudflare.com/workers/) seamlessly.
103105

104106
The minimum [API Token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) permissions needed
105107
are:

0 commit comments

Comments
 (0)