3 ms·
How does this work?
by marmada 6y ago
How does this work?
- eat_veggies 6y agoEach button is a separate image that links to my website, which records the letter, and then redirects you back to GitHub. The top part of the screen is dynamically generated, and you can view it directly here: https://kbd.jse.li/screen.gif https://kbd.jse.li/screen.gif
- uzyn 6y agoDoesn't GitHub cache fetched images? Any tricks required to get GitHub to refresh the image?
- eat_veggies 6y agoFor most use cases, like for CI badges, setting cache-control and etag headers will suffice, but GitHub still caches it (just for a shorter time? I don't know the specifics). Luckily, you can request that they purge their cache for a specific file [0] so I've got a goroutine that calls it once per second [1] [0] https://docs.github.com/en/github/authenticating-to-github/about-anonymized-image-urls#removing-an-image-from-camos-cache https://docs.github.com/en/github/authenticating-to-github/a... [1] https://github.com/veggiedefender/typing/blob/0ed7c9c17970d6c1b2a7f16ec9acd20fb3bffd2b/handler.go#L86-L103 https://github.com/veggiedefender/typing/blob/0ed7c9c17970d6...