| sequenceDiagram | |
| participant User | |
| participant API | |
| participant DB | |
| participant Cache | |
| User->>API: GET /profile | |
| API->>Cache: Check cache | |
| alt Cache hit | |
| Cache-->>API: Return cached profile | |
| else Cache miss | |
| API->>DB: SELECT * FROM users WHERE id=? | |
| DB-->>API: User row | |
| API->>Cache: SET profile (TTL 300s) | |
| end | |
| API-->>User: 200 OK { profile } | |