OS X Yosemite suspends inactive windows
It might be going into "App Nap"

To disable this for Safari go to Finder, hit ⌘+I and check "Prevent App Nap": 


You can check to see if it worked by going opening up Activity Monitor, clicking the Energy tab and seeing if Safari is in sleep mode.