Skip to content

Commit

Permalink
Merge pull request leg100#2 from leg100/feature/cache-control
Browse files Browse the repository at this point in the history
Disable caching
  • Loading branch information
leg100 authored Oct 4, 2019
2 parents b55fd17 + 0fb8e77 commit 04d4068
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,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

0 comments on commit 04d4068

Please sign in to comment.