-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Description
Rate Limit ignored when endpoint is cached in FastAPI.
In this simple example the limiter is completely ignored when I tested.
from fastapi_cache.decorator import cache
@router.get(
"/api/v1/templates/{template_type}/{version}",
response_class=MarkdownResponse,
)
@cache(expire=300) # Cache for 300 seconds
@limiter.limit("15/minute")
async def get_template(
template_type: str,
version: str,
request: Request,
current_principle: dict[str, str] = Depends(get_current_active_principle),
):
print("Fetching template:", template_type, version)
...Project Dependencies
dependencies = [
"bcrypt<4.0.0",
"fastapi>=0.128.0",
"fastapi-cache2>=0.2.2",
"passlib>=1.7.4",
"pydantic>=2.12.5",
"pyjwt>=2.10.1",
"python-dotenv>=1.2.1",
"python-multipart>=0.0.21",
"pyyaml>=6.0.3",
"slowapi>=0.1.9",
"toml>=0.10.2",
]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels