ajoshi0, glad it helped you :) Often solutions are really, really stupid simple, that's why it's hard to find them.
gooma2, yes, we know that. I did a lot of testing, logged in and out, asked many friends from around the world to check the site - logged in and out as well, from different browsers and clearing browser cache. Everything is working fine now. I'm not telling this fix will definitely help anyone in all possible cases, but it helped me and at least one more person. Seems like it's worth a try.
I got my hands a bit deeper on this and my suggestion is that if there are some particular feature(s) not supported by your server config (or php config) but needed for debug mode to work properly, it encounters error / warning / notice or smth like that and stops execution. That's why it writes a blank file to the cache. Definitely needs some more testing to find the roots but I don't have time right now to do this. W3TC now works on my site and I'm happy.