feat(api): add Redis session cache to reduce Appwrite API calls by ~90% #3

Merged
ptarrant merged 1 commits from feat/optimize-api-auth-calls into dev 2025-11-26 04:01:53 +00:00
Owner
  • Add SessionCacheService with 5-minute TTL Redis cache
  • Cache validated sessions to avoid redundant Appwrite calls
  • Add /api/v1/auth/me endpoint for retrieving current user
  • Invalidate cache on logout and password reset
  • Add session_cache config to auth section (Redis db 2)
  • Fix Docker Redis hostname (localhost -> redis)
  • Handle timezone-aware datetime comparisons

Security: tokens hashed before use as cache keys, explicit
invalidation on logout/password change, graceful degradation
when Redis unavailable.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

- Add SessionCacheService with 5-minute TTL Redis cache - Cache validated sessions to avoid redundant Appwrite calls - Add /api/v1/auth/me endpoint for retrieving current user - Invalidate cache on logout and password reset - Add session_cache config to auth section (Redis db 2) - Fix Docker Redis hostname (localhost -> redis) - Handle timezone-aware datetime comparisons Security: tokens hashed before use as cache keys, explicit invalidation on logout/password change, graceful degradation when Redis unavailable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
ptarrant added 1 commit 2025-11-26 04:01:49 +00:00
- Add SessionCacheService with 5-minute TTL Redis cache
- Cache validated sessions to avoid redundant Appwrite calls
- Add /api/v1/auth/me endpoint for retrieving current user
- Invalidate cache on logout and password reset
- Add session_cache config to auth section (Redis db 2)
- Fix Docker Redis hostname (localhost -> redis)
- Handle timezone-aware datetime comparisons

Security: tokens hashed before use as cache keys, explicit
invalidation on logout/password change, graceful degradation
when Redis unavailable.

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

Co-Authored-By: Claude <noreply@anthropic.com>
ptarrant merged commit 52b199ff10 into dev 2025-11-26 04:01:53 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ptarrant/Code_of_Conquest#3