Disable Wifi sleep mode on Pi3 and Pi ZERO W

Hi Guys,
i am using a Pi Zero W as QA System and a Pi3 as productive system, both connected via WLAN to my Network.
On both i always had the issue that suddenly OH was not available anymore and after some trying it came back, like the Pi had to wake up. I was looking in the messages log and a few other things, but have not found anything, but it seems the Wifi connection was put into a sleep mode after some time.

After a bit searching i found this article: https://www.kuerbis.org/2016/03/raspberry-pi-3-kurztipps-wlan-sleep-mode-verhindern/

It says you can add a line in the /etc/network/interfaces to avoid the wifi power save mode.
Just add the line “wireless-power off” to the right network card, it should look like this then:

allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
wireless-power off

allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
wireless-power off