scc icon indicating copy to clipboard operation
scc copied to clipboard

Incorrect calculation of the number of lines in a badge if it was added to the repository at the start

Open pomponchik opened this issue 2 years ago • 3 comments

Hello!

I have added your experimental badge to several of my repositories. Several of them work fine, and several always display the same fixed number of lines: 18.

The badge works fine in these repositories:

But! For these repositories, "18" is always displayed:

I guess the difference is that in the second group of repositories, the badge was added at the start. I put the badge in the develop branch and they got into the main with the first PR.

pomponchik avatar Feb 24 '24 17:02 pomponchik

Its usually a case of github caching it. If you look at the actual rendered link it goes though githubs servers first.

For example https://camo.githubusercontent.com/b19935ed836c142d0eb7b654cc2045c600b5cfd273f316f16760af3511b722d0/68747470733a2f2f736c6f632e78797a2f6769746875622f706f6d706f6e6368696b2f7369676d617463682f3f63617465676f72793d636f6465 is the link for sigmatch from the above.

I don't actually know how to bust this cache myself....

While the badge server does cache as well its not as aggressive as the github one.

boyter avatar Feb 25 '24 21:02 boyter

I found the answer!

Look:

You need only a question sign.

I think we should add it to the docs.

pomponchik avatar Feb 27 '24 17:02 pomponchik

I think that will only bust the cache once though. Of course you can always add more at the end to rebust it.

Ill have a look through that thread because there might be some other solutions raised.

boyter avatar Feb 27 '24 21:02 boyter