Most cakes last good in the fridge, real problems come with the frosting and the air. You must cover the cake tightly and it must be stored with proper care. You can cover your cake with an air-tight container or bag as it will make your cake stay fresh. If you want to freeze your cake, then put it in the freezer and wait until it gets frozen and then put it out and wrap it carefully, unwrap it before defrosting. This is the whole process you can rely on and store your cake for long. The Shelf Life of the Cake also depends on the method it is prepared, normally a Cake can be good for up to 4 days without going bad and if you store them in a fridge it can be good for up to a week. Frozen Cakes can be last long but they must be stored in a Freezer for 2 to 3 months.
You can easily get to know that your cake is no longer good, it will become hard and textureless, and mold starts to appear, the other thing is the fruit filing they also get slimy.
Fruit cakes have a generally long shelf life as compared to the other flavor cakes and they can be stored in a freezer for a year or more. If you want to store cake for a long period, you must take proper actions and measures. All the cake must be stored in an airtight plastic container or wrapped well in plastic. somehow it gets smelled or gets mold you must throw it away.