Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

badgen.net don't respect cache option #648

Open
zhongfly opened this issue Sep 23, 2023 · 1 comment
Open

badgen.net don't respect cache option #648

zhongfly opened this issue Sep 23, 2023 · 1 comment
Labels

Comments

@zhongfly
Copy link
Contributor

zhongfly commented Sep 23, 2023

As doc said,we can use https://flat.badgen.net/.....?cache=300 to control cache time. But this option is no longer work.
From reponse header,I find the cache-control don't use the value set in 'cache' option:

curl --head https://flat.badgen.net/static/color/blue/blue?cache=300

HTTP/1.1 200 OK
Age: 0
Cache-Control: public, max-age=86400
Connection: keep-alive
Content-Length: 0
Content-Type: image/svg+xml;charset=utf-8
Date: Sat, 23 Sep 2023 02:58:26 GMT
Etag: "13lt1lma0fyiu"
Server: Vercel
Strict-Transport-Security: max-age=63072000
X-Matched-Path: /api/static
X-Vercel-Cache: MISS
X-Vercel-Id: sin1::sin1::wblkh-1695437906444-6252f7b3db1f

Cache-Control should be max-age=300 not max-age=86400 because I set '300' in cache option.

It will result the badgen which used in github and cache by github not update as expected, because github determines whether to update its image cache via Cache-Control.
ref: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls#an-image-that-changed-recently-is-not-updating

@amio amio added the bug label Sep 25, 2023
@amio
Copy link
Member

amio commented Sep 25, 2023

This should be a bug

@zhongfly zhongfly changed the title badgen.net don't respect 'cache' option badgen.net don't respect cache option Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants