It is also a good idea to have a resistor in series with the capacitor to reduce in-rush current if the switch closes at the peak of the sine wave. The capacitor will appear as a short circuit until charged ( a few milliseconds ) meaning the switch contacts will sometimes be stressed beyond normal operating current when it closes. This may slightly reduce the life of the switch
