Paul__B:
This is however, absolutely irrelevant to the discussion here. A current surge will occur if the circuit is connected while the AC voltage is non-zero and this will be greatest if connected at the peak of the waveform. It will be even more if the capacitor should happen to have a residual voltage in the opposite direction and given a 1k resistor, it is quite easy to calculate the possible peak values. It is equally possible to calculate the time constant of this current surge as 100µs and that the current will drop back to the rated current of the optocoupler within 300µs worst case, so you can make your determinations as to how likely this is to cause damage, accordingly.
Well I had my head up, I was believing LTspice rather than thinking. Hate it when that happens. I'm with you now, surge current 170mA. Checking a couple datasheets, 1N4148 has a forward surge current rating of 350mA for 1 sec, and 4N35 of 2.5A for 10µs, so it's not something that would keep me up nights. Actually, done properly, LTspice will model it nicely.