Make the syrup: combine the sugar, vinegar, water, and salt in a small saucepan. Bring to a boil over medium-high heat, stirring until the sugar dissolves completely. Remove from heat and cool to room temperature. (The syrup can be made ahead and refrigerated in a jar.)
While the syrup cools, slice the cucumber, shallots, and chile. Keep everything cold.
Just before serving, put the cucumber, shallots, and chile in a serving bowl and pour over enough cooled syrup to barely cover the vegetables. Toss gently.
Garnish with cilantro if using. Serve immediately at room temperature or lightly chilled.