Skip to content

add redis cache for quicker lookups#9

Draft
vzcodes wants to merge 1 commit into
cassiofb-dev:masterfrom
vzcodes:master
Draft

add redis cache for quicker lookups#9
vzcodes wants to merge 1 commit into
cassiofb-dev:masterfrom
vzcodes:master

Conversation

@vzcodes

@vzcodes vzcodes commented May 11, 2025

Copy link
Copy Markdown

Speed up lookups by implementing a simple redis cache in python.

FIDE ratings only update once per month so this is the perfect use case for implementing a redis cache.

Closes #8

image

@vercel

vercel Bot commented May 11, 2025

Copy link
Copy Markdown

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

Name Status Preview Comments Updated (UTC)
fide-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 11, 2025 5:41am

@vzcodes

vzcodes commented May 11, 2025

Copy link
Copy Markdown
Author

I'm pretty sure Vercel won't be able to deploy a redis cache without using a redis cloud offering.

Edit: I deployed this version to docker running in a linux server and as you can see there is big improvements in the performance. See the deployed version here.

image

@cassiofb-dev

Copy link
Copy Markdown
Owner

Thats really awesome!

The vercel preview is working fine.
Do you want to edit the readme and include this instance?

@vzcodes

vzcodes commented May 11, 2025

Copy link
Copy Markdown
Author

No, it's not going to work with the current deployment configuration. As in the api will work without the cache. I've set it up to run redis inside the docker container. I checked out Vercel and it's currently going to run whatever is in the Vercel Function. It's stateless.

The only way to keep Vercel and run a Redis cache is to implement a cloud based one https://redis.io/docs/latest/operate/rc/cloud-integrations/vercel/

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

Successfully merging this pull request may close these issues.

Add a redis cache to speed up the execution of common requests

2 participants