01 -
Mix together the sugar, pineapple juice, vinegar, and salt in a large, sturdy pan on a stove. Slowly bring it all to a light boil.
02 -
Throw in the minced garlic, chili flakes, and ketchup if you're using it. Let it simmer for about 5 minutes over medium heat.
03 -
Turn the heat down to low, then carefully stir in the cornstarch mixture a little at a time to avoid lumps.
04 -
Keep it on low heat and stir now and then. The sauce will thicken up as it cooks and will set even more once cooled.
05 -
Once it has completely cooled, pour it into a sterilized bottle or jar and pop it in the fridge for storage.