Skip to content

Commit

Permalink
Add Cache-Control header to local get action
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh1nku committed Jun 6, 2023
1 parent 7a8bbd9 commit dcb09d2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/count_loc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ jobs:
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Count lines of code
id: loc
- uses: actions/checkout@v3
- id: loc
name: Count lines of code
uses: Sh1nku/count-loc-action@v1
with:
excluded: '*.json,*.svg,*.md,*.toml'

- name: Update badge
uses: Sh1nku/update-badgestore-badge-action@v1
excluded: "*.json,*.svg,*.md"
- uses: Sh1nku/badgestore-update-badge-action@v1
name: Update badge
id: badge
with:
right-label: ${{ steps.loc.outputs.sum }}
read-write-key: ${{ secrets.BADGE_AUTH }}
right-label: ${{ steps.loc.outputs.Total_code }}
read-write-key: ${{ secrets.BADGESTORE_RW_KEY }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Badgestore
![Lines of Code badge]()
![Lines of Code badge](https://api.badgestore.dev/badge/108db75934eb5ec0/local)

This is the front-end and back-end for [badgestore.dev](https://badgestore.dev). The website allows you to create badges, and update them.

Expand All @@ -14,7 +14,7 @@ The front-end is written in [Svelte](https://svelte.dev) and the back-end is wri
## How to use
### Creating a badge
#### Using the website
To create a badge, go to [badgestore.dev](https://badgestore.dev) and click on the `Generate badge` button.
To create a badge, go to [badgestore.dev](https://badgestore.dev) and click on the `Generate` button.
#### Using the API
Take a look at [api.badgestore.dev](https://api.badgestore.dev)
### Updating a badge
Expand Down
3 changes: 3 additions & 0 deletions back_end/src/api/routes/badge_get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,8 @@ pub fn svg_response(svg: &str) -> impl IntoResponse {
header::CONTENT_TYPE,
HeaderValue::from_static("image/svg+xml"),
);
response
.headers_mut()
.insert(header::CACHE_CONTROL, HeaderValue::from_static("no-cache"));
response.into_response()
}

0 comments on commit dcb09d2

Please sign in to comment.