How is appID used in caching? I want to ensure that cache is set per domain at a config level. So rather than saying something like this in the template:

{% cache using key craft.config.getHostInfo ~ '.' ~ entry.slug ~ '.masterPrimaryNav' %}
    foo
{% endcache %}


I would like to set this in config so the cache key is prepended automatically. I had hoped that the general appId would help this on config, but I can't see that being set in the cache key when I set it: http://buildwithcraft.com/docs/config-settings#appId

Is there a way to do this?
appId wont help you there. If you take a look at the source code, you'll see how the appId is used in sessions.

I'm not aware of an automatic way to prepend cache keys.