pull up or pull down resistor for optocoupler
That's quite a large electrolytic capacitor.. it will take some time to discharge through R1 to a safe voltage. 10uF would work as well and would be smaller, safer. 

Nominal power dissipation is about 1W regardless of whether the opto is on or off. 

If you want to stay with this, use a physically larger resistor rated at a few watts, and it won't get as hot (but of course it will be dissipating the same amount of power). Preferably a MOF type  that is flameproof and rated for mains voltage.