Skip to content

Commit 3850106

Browse files
authored
Enhance README with cache-busting techniques
Expanded README with detailed usage instructions and explanations for cache-busting techniques.
1 parent e30959f commit 3850106

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,35 @@
11
# test-github-cache-bust
2-
Demo repo for testing/validating the behavior of GitHub's camo image-cache service.
32

4-
This repo-stats card shows the number of open Issues.
3+
## Demo repo for testing/validating the behavior of GitHub's image-caching service (camo)
54

6-
Create a new issue in this repo and observe whether the change is reflected immediately.
5+
### What is this?
76

7+
The cards on this page are [`github-readme-stats`](https://github.com/anuraghazra/github-readme-stats/) repo cards (adapted on a [fork](https://github.com/hesreallyhim/github-readme-stats-plus/) created and hosted by hesreallyhim in order to show more repo stats). They show the number of open Issues in this repo.
8+
9+
### OK, so what?
10+
11+
Create a new Issue in this repo and observe whether the change is reflected immediately. GitHub uses a service called [camo](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls) for image caching and privacy/anonymization. That means that if you are serving an image with dynamic contentk changes to the content may not be reflected right away. This repo illustrates different approaches to cache-busting so you can see for yourself what works or does not work at the current point in time.
12+
13+
## 1. Baseline (no cache-busting techniques applied)
14+
15+
### Usage
16+
17+
> [!tip]
18+
> Create a new Issue in the repo. Do **not** include the word "nonce" anywhere in the body. See if and when the count on the card is actually updated.
19+
20+
<div id="baseline">
821
[![test-github-cache-bust](https://github-readme-stats-plus-theta.vercel.app/api/pin?username=hesreallyhim&repo=test-github-cache-bust&show_issues=true)](https://github.com/hesreallyhim)
22+
</div>
23+
24+
25+
## 2. Nonce Query Parameter (image URL contains "nonce" query-parameter with random numerical value)
26+
27+
### Usage
28+
29+
The image URL below contains a query parameter `nonce` with a random number value. Create an Issue in this repository and write the word "nonce" somewhere in the body. This will trigger a GitHub Action that changes the query parameter value to some other "random" number. This is used to test whether changing query parameters is sufficient to bust the cache and refresh the image.
30+
31+
<div id="baseline">
32+
[![test-github-cache-bust](https://github-readme-stats-plus-theta.vercel.app/api/pin?username=hesreallyhim&repo=test-github-cache-bust&show_issues=true&nonce=123456)](https://github.com/hesreallyhim)
33+
</div>
34+
35+

0 commit comments

Comments
 (0)