Remove the stalks from the chillies. For a milder sauce remove the seeds from half of them. For full heat leave all seeds in. Roughly chop the chillies, garlic and ginger.
Place the chopped chillies, garlic and ginger in a blender or food processor and blitz to a coarse paste. Don't blend completely smooth, some texture in the finished sauce is more authentic.
Combine the rice vinegar, sugar, water and salt in a medium saucepan. Stir over a low heat until the sugar has fully dissolved.
Add the chilli paste to the pan and bring to a gentle boil, stirring regularly.
Reduce heat and simmer for 12-15 minutes, stirring every few minutes, until the sauce has reduced and thickened to a glossy, lightly syrupy consistency. It should coat the back of a spoon. The sauce will thicken further as it cools. Be careful not to over-reduce it.
If using fish sauce, add in the final 2 minutes of cooking. Taste and adjust if needed (more sugar for sweetness, more chilli for heat, a little more vinegar if it needs sharpness).
If the sauce is too thin after cooling, return to the heat and stir in the cornflour slurry. Cook for 1-2 minutes until thickened. Alternatively reduce by simmering a further 5 minutes.
Allow to cool to room temperature. Transfer to a sterilised jar or bottle. Keeps refrigerated for up to 6 weeks.