What should I do, if I don't want to change the cache folder's permissions to 777?

It’s given by a bad server configuration if you need 777 permissions to have your folders writable by PHP, and you could try to contact your server host, but they usually won’t change it, so you should consider moving to another host instead. Although only a very small percentage of websites are hacked, and if yours would be, folder permissions won’t stop any proper hacker, also your database is still fully accessable even if your files aren’t. So you shouldn’t really worry about it, just make a backup from your whole site now and then.