This is the right thing to do if you want to cache a value that is performance intensive to get. So yes that is totally fine 🙂
Caching this way vs a graph variable: cache node should be better performance wise, but we are talking about minimal differences if any, therefore I would suggest to just use the workflow that you prefer better 🙂