An open API service indexing awesome lists of open source software.

https://github.com/tatevik-h/fastapi-redis-cache

FastAPI + Redis: Advanced caching service
https://github.com/tatevik-h/fastapi-redis-cache

caching cli-tool docker fastapi python redis rest-api sqlalchemy

Last synced: about 2 months ago
JSON representation

FastAPI + Redis: Advanced caching service

Awesome Lists containing this project

README

          

# fastapi-redis-cache
FastAPI + Redis: Advanced caching service

## Features
- Payload generation & retrieval
- PostgreSQL persistence
- CLI tool for programmatic testing

## Requirements
- Python
- Docker & Docker Compose
- Redis

## API Endpoints

### 1. Create Payload
**POST /payload**

Generates a new payload (or reuses existing one if already cached).
- Transforms input strings
- Caches results in Redis & DB
- Returns a uinque payload ID

**Request body:**
```json
{
"list_1": ["first string”, “second string”, “third string”],
"list_2": ["other string”, “another string”, “last string”]
}
```
**Response:**
```json

{
"id": "payload_123abc"
}
```

### 2. Get Payload
**GET /payload/{id}**

Retrieves a previously generated payload by ID.

**Response:**
```json
{
"output": "FIRST STRING, OTHER STRING, SECOND STRING, ANOTHER STRING, THIRD STRING, LAST STRING"
}
```