Add the onion and apple to the pan and cook, stirring often, until softened, about 4-5 minutes. Stir in the cider, vinegar, sugar, jelly, cinnamon and cayenne and increase the heat to medium high to bring to a boil. Cook, stirring, 2 minutes; add the bacon, reduce the heat to medium and cook, stirring occasionally, until the mixture is syrupy and thickened, about 30 minutes. (When it is thickened, a spoon drawn across the pan surface will leave a line that takes time to close back up.) Allow to cool completely. (The jam may be made a week ahead and kept refrigerated).