Frontend: Fix a bug with directory media caching