FastAPI Caching

Community

Boost FastAPI performance with Redis.

Authormarkus41
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill addresses the performance bottlenecks in FastAPI applications by implementing efficient caching strategies using Redis, reducing database load and improving response times.

Core Features & Use Cases

  • Redis Client Setup: Provides a robust RedisCache class for connecting, retrieving, setting, and deleting cached data.
  • Cache Decorator: Enables easy caching of asynchronous function results with customizable keys and expiration times.
  • Response Caching Middleware: Caches entire HTTP responses for GET requests to further optimize API performance.
  • Cache Patterns: Demonstrates Cache-Aside, Write-Through, and invalidation patterns for effective data management.
  • Use Case: Implement Redis caching for frequently accessed user data in a FastAPI backend to significantly speed up read operations and reduce the load on your primary database.

Quick Start

Integrate the provided Redis client setup and cache decorator into your FastAPI application to start caching API responses.

Dependency Matrix

Required Modules

None required

Components

referencesassets

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: FastAPI Caching
Download link: https://github.com/markus41/claude/archive/main.zip#fastapi-caching

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.