graph TD A[Automatic subscriptions caching] --> L L[For each subscription] --> K L --> |No more subscription| Z K[For each unprocessed new media] --> M M{Is cache size reached for the current pass?} M -->|Yes| Z M -->|No| C C{Is max nb items reached?} C -->|Yes| D[Evict oldest media in this subscription] --> G C -->|No| G G[Check maximum cache size] --> H{Is max cache size reached?} H -->|Yes| I[Evict oldest overall media] --> J H -->|No| J J[Cache new media] J --> K J --> |No more media| L Z[Done]