Skip to content

Commit 38ccf07

Browse files
committed
Fix badge caching headers for GitHub display
1 parent 1b0999e commit 38ccf07

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,27 @@ A fast, reusable GitHub profile hit counter that generates beautiful badge image
1515
Add to your GitHub profile README:
1616

1717
```markdown
18-
![Profile Views](https://your-deployed-url.com/badge/your-username)
18+
![Profile Views](https://githitbox.duckdns.org/badge/your-username)
1919
```
2020

21-
Replace `your-username` with your GitHub username and `your-deployed-url.com` with your deployed application URL.
21+
Replace `your-username` with your GitHub username.
2222

2323
### Badge Styles
2424

2525
```markdown
26-
![Flat](https://your-deployed-url.com/badge/octocat)
27-
![Plastic](https://your-deployed-url.com/badge/octocat?style=plastic)
28-
![Counter](https://your-deployed-url.com/badge/octocat?style=counter)
29-
![For-the-badge](https://your-deployed-url.com/badge/octocat?style=for-the-badge)
26+
![Flat](https://githitbox.duckdns.org/badge/octocat)
27+
![Plastic](https://githitbox.duckdns.org/badge/octocat?style=plastic)
28+
![Counter](https://githitbox.duckdns.org/badge/octocat?style=counter)
29+
![For-the-badge](https://githitbox.duckdns.org/badge/octocat?style=for-the-badge)
3030
```
3131

32+
### Live Examples:
33+
34+
![Flat](https://githitbox.duckdns.org/badge/octocat?v=1)
35+
![Plastic](https://githitbox.duckdns.org/badge/octocat?style=plastic&v=1)
36+
![Counter](https://githitbox.duckdns.org/badge/octocat?style=counter&v=1)
37+
![For-the-badge](https://githitbox.duckdns.org/badge/octocat?style=for-the-badge&v=1)
38+
3239
## 🛠️ Local Development
3340

3441
```bash

main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ async def get_profile_badge(
238238
io.BytesIO(img_bytes.read()),
239239
media_type="image/png",
240240
headers={
241-
"Cache-Control": "no-cache, no-store, must-revalidate",
242-
"Pragma": "no-cache",
243-
"Expires": "0",
241+
"Cache-Control": "public, max-age=60",
242+
"Content-Type": "image/png",
243+
"Access-Control-Allow-Origin": "*",
244244
},
245245
)
246246

0 commit comments

Comments
 (0)