In a large heavy bottom pan add sugar, pineapple juice , vinegar , salt. Bring the mixture to a boil. Add chili flakes, minced garlic and ketchup. Boil on medium heat for 5 minutes. Mix cornflour and cold water. Lower the heat and stir in slowly, trying to avoid lumps. Cook the mixture on low heat till it thickens and comes to desired sauce like consistency. (The sauce will thicken when it cools down.) Store cooled sauce in sterilized bottle. Refrigerate.