Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
How long will this apple compote keep in the fridge?
How long do you want to keep it ?
I'd say a couple of days.
If wanting to keep it longer, I'd freeze it in portions in freezer "ziplock" bags.
You can keep a homemade compote from 48h to 7 days regarding how it is stored in the fridge, closed, the amount of sugar etc...