Skip to content

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

Open
ShivamHP wants to merge 1 commit intoanarchy-ai:mainfrom
ShivamHP:main
Open

Added caching for repititive requests on the /v1/complete endpoint#430
ShivamHP wants to merge 1 commit intoanarchy-ai:mainfrom
ShivamHP:main

Conversation

@ShivamHP
Copy link
Copy Markdown

@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