>>21509099
Super high sugar content, and a hint of citric acid gives even regular pastries the ability to stay fresh for a few days before it starts to mold.
If you add an airtight seal and a sterile environment, you effectively eliminate the issue of mold or bacteria and it can stay good for months. The only real limiting factor is potential loss of moisture if your packaging is water permeable, oils turning rancid which inevitably occurs in about a year depending on the oil used, or cream/icing separating over time if you're not using emulsifiers.
I wouldn't say that your fears of cheap dessert cake slop are unfounded, but the long-lasting aspect is totally natural. The strange flours, oils, and emulsifiers they use, combined with the lack of nutrition besides cheap energy, are what you should be worried about.