on-internet
← Community

Modern apis with FastAPI - Redis Caching

Stack Overflow ·

I'm trying to implement the redis caching in my API for the first time it is a simple fastapi application which is using openweather api to query some weather information and my intention is to cache each json response in the redis server. I'hve made it to work with single key city but with this approach validating query parameters not working with the error handling I put in the place. caching.py import sys from datetime import timedelta import json import redis from services.openweather_service import get_report def redis_connect() -> redis.client.Redis: try: client = redis.Redis( host="loca

Comments

Sign in or sign up to comment and upvote.

No comments yet.