If you rectify the line voltage, maybe grabbing peaks at 160 volts, and you need t0to provide 100 watts for 100 seconds, and your downstream switching regulator has a 40 volt dropout, how big a capacitor will you need?
For 100 seconds, and 100 watts, you need to store 10,000 joules (watt * seconds) OR MORE. At 40/160 dropout, or 25%, that is close to 100% nergyenergy extraction, w'll ignore that 25% and compute what is needed.
Energy = 0.5 * C * V^2
and we manipulate
Energy / ( 0.5 * V * V) = C
10,000 / (0.5 * 160 * 160) = 10,000 / (0.5 * 25,600) = 10,00 / 12,800
C = 0.8 farads at 250 volt rating