feat: integrate MinIO storage for image caching service

- Replace file system storage with MinIO object storage
- Add MinIO cache implementation with 3-level directory structure
- Support dynamic switching between MinIO and filesystem via config
- Fix metadata encoding issue for non-ASCII URLs
- Successfully tested with various image sources including Korean URLs

All image service features working:
- Image proxy and download
- 5 size variants (thumb, card, list, detail, hero)
- WebP format conversion
- Cache hit/miss detection
- Background size generation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
jungwoo choi
2025-09-12 07:46:12 +09:00
parent 005088189f
commit 8866a90f65
4 changed files with 432 additions and 4 deletions

View File

@ -5,9 +5,14 @@ import mimetypes
from pathlib import Path
import hashlib
from ..core.cache import cache
from ..core.config import settings
# MinIO 사용 여부에 따라 적절한 캐시 모듈 선택
if settings.use_minio:
from ..core.minio_cache import cache
else:
from ..core.cache import cache
router = APIRouter()
@router.get("/image")
@ -113,7 +118,7 @@ async def get_stats():
"""캐시 통계 정보"""
cache_size = await cache.get_cache_size()
# 디렉토리 구조 통계 추가
# 디렉토리 구조 통계 추가 (MinIO 또는 파일시스템)
dir_stats = await cache.get_directory_stats()
return {