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

Improve Badge caching #573

Open
rvalentini opened this issue Apr 6, 2022 · 3 comments
Open

Improve Badge caching #573

rvalentini opened this issue Apr 6, 2022 · 3 comments

Comments

@rvalentini
Copy link
Member

The following behavior was reported when using Cljdoc badges on Github:
When refreshing the Github page shortly after a successful build of a newer release version, the link of the Cljdoc badge already resolves to the newer release version, whereas the Cljdoc badge SVG is still showing the old version. This is probably due to our caching configuration for badges.

Maybe an option could be to introduce conditional requests by setting the Last-Modified or ETag response header for badges?

@corasaurus-hex
Copy link
Contributor

It looks like we could use the not-modified ring middleware to do etags and lowering the max-age is pretty simple. I wonder how many more requests we'd be talking, though, and how the server would do under the extra load?

<aside>
Coming at this from another angle: If we could throw something like Varnish in front of cljdoc we could control our own caching and evicting and serve a ton more reqs/s without breaking a sweat. I'm not sure that's something people would be up for, though.
</aside>

I do like the idea of generating our own svg badges and I think we could probably do it fairly easily? https://github.com/lmarkus/openBadge

@lread
Copy link
Member

lread commented Apr 15, 2022

Yeah, I thought delivering badges ourselves could be pretty straightforward too @corasaurus-hex: #422 (comment).

@corasaurus-hex
Copy link
Contributor

Oooooh! great minds and all that 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants