Easiest is to replace the cap and future problems with it are solved. Sometimes the contact lug inside the cap can be closed up a bit, to make better. To do this, unscrew the cap from the plug lead. Use a flash light to look inside at the condition of the cap lug internals. Depending on the condition of the cap and the type of cap that you have on your bike, you may be able to tweak the contact lug a bit with a narrow screwdriver. Take care that you don't damage the rubber casing. Also take note, that the tip of the spark plug (where it makes contact with the plug cap) is screwed up tightly. For what it's worth, replace the cap. Way easier and less hassle in the long run.