Scald tomatoes with boiling water, peel off the skin and roughly chop. Cut the apricots into fine strips. Peel the ginger and garlic cloves and chop them very finely. Put together with tomatoes and apricots in a wide, shallow saucepan and season with sugar, vinegar, salt and cayenne pepper. Bring to the boil, then boil down thickly over low heat for about 2 hours, stirring frequently. Fill into 2 prepared jars and close (like jam). Keeps closed for at least a year.