feat: Redis search cache with configurable TTL

- Add optional Redis caching for search results (REDIS_URL env var)
- Cache TTL configurable via UI: 0h (disabled) to 168h (1 week), default 6h
- New backend modules: cache.py (async Redis get/set/flush), settings.py (SQLite settings table)
- New API endpoints: GET/PUT /api/settings, DELETE /api/cache
- New 'Cache' tab in Settings modal with status indicator, preset buttons, slider, and flush
- Cache keys are deterministic hashes of query+category+page+image_size+engines
- Redis is fully optional: graceful no-op when REDIS_URL unset or Redis unreachable
- Updated Dockerfile, README, CHANGELOG, FEATURES

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-23 17:26:14 +11:00
co-authored by Copilot
parent bf76393456
commit e9a5d68553
14 changed files with 525 additions and 6 deletions
+4
View File
@@ -24,6 +24,10 @@ COPY backend/ .
# Copy frontend build output to static dir
COPY --from=frontend-build /app/frontend/dist /app/static
# Redis is optional — set REDIS_URL to enable caching
# e.g. docker run -e REDIS_URL=redis://redis:6379 ...
ENV REDIS_URL=""
EXPOSE 8000
CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]