I need a Map to make a cache in Java for same values that I have two String keys. My question it\'s better to make nested Maps (one for each key) or make some type of custom
Using combined keys seems more logical to me, and easier to use (you don't have to worry about the nested map being instancied).
About the combination of the keys, use a custom class. It makes more sense semantically, and prevents colisions if you have similar strings. Such a colision could appear if you have the key ["ab", "c"] and the key ["a", "bc"].
Remember when you write your custom class, you need to write the equals and hashCode methods correctly, or your cache might not work (and might suffer performance issues as well).