Add custom cache key functionality

Had to create a new PR because my old repo had old merge commits. So made a new repo and PR to clean the commits up as asked in the old PR.

Adds the option to set a custom cache key to be used instead of the uri based one.
I hope this is alright. Should be similar to the last PR that was made for this. I am new to writing tests and feedback is very welcome. If something should be changed comment please.

Thanks
Should we accept empty string here? Perhaps...it would be a bad mistake of the caller but we shouldnt crash.