Skip to content

Add Redis caching for GET endpoint - add Redis caching for order reads (cache order summary) #4

@raggopaluni

Description

@raggopaluni

Goal:

  • Use Redis to cache order summary (metadata + small spec fields) to speed up reads.

Tasks:

  • Add services/redis_client.py (Singleton).
  • On GET /orders/{order_id}:
    • Check Redis cached key order:{order_id}.
    • If hit, return cached value.
    • If miss, fetch from Postgres+Mongo, cache a summary with TTL 300s, then return.
  • Add cache invalidation on PUT/DELETE if implemented.
  • Add Redis to docker-compose.

Acceptance criteria:

  • Repeated GETs within TTL show cache hits (log or metric).
  • Cache is invalidated/updated upon order updates (if PUT implemented).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions