Preheat the oven to 170°C (conventional). Lightly grease a shallow ovenproof dish of approximately 2 litres.
Whisk the custard sugar, cake flour and salt together in a heatproof bowl. Heat the milk until steaming and almost simmering, but not boiling.
Gradually whisk a little hot milk into the flour mixture to make a smooth paste. Add the remaining milk slowly, whisking well. Return the mixture to the saucepan.
Cook over low heat, stirring continuously and scraping the base of the pan, until the custard thickens and the flour has cooked through, about 5–8 minutes. Remove from the heat.
Lightly beat the egg yolks. Whisk a few spoonfuls of warm custard into them to temper, then stir back into the custard with the melted butter and vanilla. Do not boil after adding the yolks.
Pour into the prepared dish and bake for 20–30 minutes, until the custard is just set and lightly coloured. Deeper dishes may need longer; the centre should have a gentle wobble.
Warm the apricot jam briefly so it spreads easily, then gently dot or brush it over the hot custard.
In a clean, dry bowl, whisk the egg whites until soft peaks form. Gradually add the caster sugar, beating until the meringue is thick, glossy and holds firm peaks.
Spoon the meringue over the jam, spreading to the edges and making soft peaks. Increase the oven to 200°C and bake for approximately 5–8 minutes, watching closely, until golden. Serve warm.