Skip to content

Conversation

@ironashram
Copy link

This PR adds Dockerfile and a simple file based caching mechanism, i've been battling slowness and timeouts for a very long time while using this project in my gh profile and this has made a huge impact.

In my testing i've gone from around 4s for each request to under 100ms (after the first one gets cached obviously)
This is currently deployed and used in my own profile with a self hosted Coolify instance.

For the Dockerfile i used node:lts-alpine, this was inspired from another PR that was already opened in the past, includes a health check, and exposes a configurable port via the PORT environment variable (defaults to 9000).

File-based caching system is defined in a new module (src/common/fileCache.js) that persists API responses to disk, reducing GitHub API calls significantly. The cache uses a 24-hour TTL by default, generates unique keys via MD5 hashes of request parameters, and handles errors gracefully so caching failures never break actual requests.

Integrated caching into all data fetchers:

  • stats.js
  • top-languages.js
  • repo.js
  • gist.js
  • wakatime.js

This is extremely beneficial in selfhosted docker scenario, i am not sure it would make any difference in Vercel since storage may not be persistent, anyway it should not break that kind of deployment or have any impact.

@vercel
Copy link

vercel bot commented Dec 23, 2025

@ironashram is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added stats-card Feature, Enhancement, Fixes related to stats the stats card. repo-card Issues related to the pin/repo card. lang-card Issues related to the language card. wakatime-card Issues related to the wakatime card. gist-card labels Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gist-card lang-card Issues related to the language card. repo-card Issues related to the pin/repo card. stats-card Feature, Enhancement, Fixes related to stats the stats card. wakatime-card Issues related to the wakatime card.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant