What is the equivalent of ~/.cache on macOS?
The right place to store such files is "Library/Caches" (either in ~ or in the app sandbox, depending on whether or not your app is sandboxed).

Apple documents this fact here:

File System Basics

Especially take note of this quote:


  Use this directory to write any app-specific support files that your
  app can re-create easily. Your app is generally responsible for
  managing the contents of this directory and for adding and deleting
  files as needed.