Clean up Repository caching madness
From https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2838#note_3772133:
The current caching setup is a bit of a mess. There are too many different expire_XXX_cache methods, too many cases where certain caches have to be flushed for either all branches or just an individual one, etc, etc. For now I'll leave this as-is but I'll put some thought in cleaning this up as I probably will have to add more caching in the coming days any way.
This should be taken care of before we add any extra caching as otherwise this rabbit hole will only get bigger and bigger.