Skip to content

M4-4: L2 Disk Cache Implementation

Description

Add SQLite-based L2 disk cache for persistence across restarts.

Acceptance Criteria

  • Add sqlite3 dependency
  • Create disk cache at /tmp/mcp-cache.db
  • 1GB maximum size limit
  • TTL: 60-300 seconds based on data type
  • Event-based invalidation on:
    • Container lifecycle events
    • Configuration file modifications
    • System reboot detection
    • Array operations

Technical Requirements

  • Use Effect.Layer for disk cache service
  • Implement as fallback to L1 memory cache
  • Thread-safe SQLite operations
  • Automatic vacuum on size limit

Estimated Effort

1 day