After checking numerous forums I am amazed that so many people are having wifi problems which apple seems to be ignoring I have tried every tip and suggestion that I could find to fix this on my 5 month old 27" iMac, including a couple of Yosemite updates and installing El Capitan. It definitely is not a router problem as I have numerous other devices that never give this problem (iPad, android phone, wifi printer, Acer netbook running linux). As the problem only occurs after wake up from sleep, I finally got around to simply disabling "put hard disks to sleep when possible" and "wake for network access" in energy saver.
THIS HAS FIXED THE PROBLEM!
THIS HAS FIXED THE PROBLEM!