Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added caching for repititive requests on the /v1/complete endpoint #430

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ShivamHP
Copy link

@ShivamHP ShivamHP commented Jan 3, 2024

Resolves #362

  • Used Flask extension Flask-Caching
  • Currently uses a local Python dictionary for caching, but can be updated to use Redis
  • Created a cache.py file which stores the config for caching and it also prevents circular imports if written directly in main.py. Also, it makes the code better organized

I am also planning to resolve the issue #360. But I need to clarify some doubts:

  • Where to store the Redis instance configuration? Should we store it as environment variables in .env.example?
  • Should I update using Python dictionary for caching to Redis for caching too?

- Used Flask extension Flask-Caching
- Currently uses a local Python dictionary for caching, but can be updated to use Redis
- Created a `cache.py` file which stores the config for caching and it also prevents circular imports if written directly in `main.py`. Also, it makes the code better organized
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.

Caching for repetitive requests on REST endpoints
1 participant