220 VAC detection using Optocoupler
You could add a capacitor in series with the resistors (a capacitor on each side, for safety reasons). If its capacity is adequate, it's impedance will drop a significant voltage without dissipating power (except a tiny amount due to its ESR).

Be sure to use mains-rated AC capacitors "X-type capacitors". Those have a "self-healing" structure that will prevent nasty failures in the case a line spike exceeds the capacitor voltage rating.

If most of the voltage is dropped on the caps you can lower the resistors by several order of magnitude (better to keep them anyway for safety, in case one of those spikes occur).

More details can be found in this other EE.SE thread.