You can offload the logic [elsewhere](https://github.com/stevenvachon/urlcache), which also supports normalization to avoid duplicates.