How can I do this? Will this prevent any cache from being saved to the hard disk?
Its not a good idea to change any default setting in TBB unless you know exactly what you are doing. This could lead to ( at the very least ) additional browser fingerprint. Making any changes is strongly discouraged!
If you read this paper you will see the Tor devs have addressed this and have made many other security/anonymity improvements.
To answer your question, you can type
about:config in your browser and hit enter, then click I accect the risk!. After that you can type
browser.cache in the search tool bar. This will lead you to your browser cache configs.
Tor Browser is imperfect and likely to leave traces here and there, and Whonix is not an amnesic system:
I highly doubt some cache setting in Tor Browser is gonna prevent that.
Neither are disposable VMs amnesic; shit still gets written to disk:
That is, until fully executed-in-RAM disposable VMs are available in Qubes. Don’t hold your breath.