github-readme-stats icon indicating copy to clipboard operation
github-readme-stats copied to clipboard

Bug with themes/styles

Open Alexasto12 opened this issue 10 months ago • 2 comments

Describe the bug

Radical theme doesn't update stats

Expected behavior

Stats must change or update when you do a commit, PR, etc.

Screenshots / Live demo link

Stats with theme "radical":

Image

Stats without a theme:

Image

Stats with theme "neon":

Image

Additional context

All screenshots have been taken at same moment

Alexasto12 avatar Feb 05 '25 18:02 Alexasto12

@Alexasto12 I've encountered the same issue with the statistics not updating correctly in the README file. After some investigation, I found that the problem was due to browser cache. Clearing the browser cache resolved the issue for me.

kouroshai avatar Feb 25 '25 09:02 kouroshai

The issue isn't specific to the radical theme ,it affects all themes :

Caching is used with expiration time of 24 hours (CONSTANTS.CARD_CACHE_SECONDS in utils.js). When you request stats with a specific theme, the result is cached .

Further request with same parameters (including same theme) will receive cached version until expiration, even if there is activity.

Different themes create separate cache entries, which is why switching themes might show updated stats (if the new theme wasn't previously cached or its cache has expired).

Workarounds: add parameters. add cache_seconds Or Wait 24 hours for cache expire

The caching mechanism is built this way only

hooiv avatar Apr 15 '25 12:04 hooiv

Hello @Alexasto12

The stats calculation does not depends from the selected theme in any way. As was stated in previous comments, you're experiencing such behavior because of cache. We are using 24 hours default cache timing on the public instance. In case you want your cards to be updated more often feel free to deploy own Vercel instance using your own GitHub API token. You will be able to set CACHE_SECONDS environment variable with any custom cache timing there.

qwerty541 avatar Sep 12 '25 15:09 qwerty541