Skip to content

Commit

Permalink
Disable caching
Browse files Browse the repository at this point in the history
  • Loading branch information
leg100 committed Oct 4, 2019
1 parent b32fb18 commit 0fb8e77
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ Next enable anyone on the internet to be able to read the badges (necessary if y
gsutil defacl ch -u AllUsers:R gs://${GOOGLE_CLOUD_PROJECT}-badges/
```

Then upload the pre-generated badges in `./badges` to the bucket (ensure they go into a directory on the bucket named `badges/`):
Then upload the pre-generated badges in `./badges` to the bucket. Ensure they go into a directory on the bucket named `badges/`. Disable caching to ensure the latest updates to a badge are visible to end-users.

```bash
gsutil -m cp ./badges/*.svg gs://${GOOGLE_CLOUD_PROJECT}-badges/badges/
gsutil -m -h "Cache-Control:no-cache,max-age=0" \
cp ./badges/*.svg gs://${GOOGLE_CLOUD_PROJECT}-badges/badges/
```

Note: the `-m` flag uploads the badges in parallel, speeding it up.

### Configure IAM

Create a new service account for use by the Cloud Function:
Expand Down Expand Up @@ -64,4 +67,4 @@ Ensure the following environment variables are set first:

* `BADGES_BUCKET`: the name of the bucket containing the badges

You'll also need to install [jq](https://stedolan.github.io/jq/) and [xq](https://github.com/jeffbr13/xq).
You'll also need to install [jq](https://stedolan.github.io/jq/) and [xq](https://github.com/jeffbr13/xq).

0 comments on commit 0fb8e77

Please sign in to comment.