Skip to content

#34 feature: add Redis for caching#35

Open
montymi wants to merge 7 commits intomainfrom
f/34/redis
Open

#34 feature: add Redis for caching#35
montymi wants to merge 7 commits intomainfrom
f/34/redis

Conversation

@montymi
Copy link
Owner

@montymi montymi commented Feb 12, 2025

This pull request introduces caching mechanisms using Redis to improve performance for fetching historical events and latest commits. The changes involve importing and using a Redis client to cache data and retrieve it when available, reducing the need for repeated external API calls.

Caching Implementation:

  • _api/date.ts: Imported the Redis client and added caching for historical event data based on the month and day query parameters. Cached data is stored for 1 hour. [1] [2] [3]
  • src/hooks/useLatestCommit.ts: Imported the Redis client and added caching for GitHub commit data based on the username parameter. Cached data is stored for 1 hour. [1] [2] [3]

Dependency Addition:

  • package.json: Added the redis package as a new dependency.

Redis Client Setup:

  • src/utils/redis-client.ts: Created a Redis client instance, configured it to connect to the Redis server, and exported the client for use in other parts of the application.

CLOSES #34

@montymi montymi self-assigned this Feb 12, 2025
@vercel
Copy link

vercel bot commented Feb 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 1:40am

@montymi montymi added the enhancement New feature or request label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: add support for caching through redis to avoid excessive API calls

1 participant