I believe the issue is that W3TC doesn’t take into account different host names when it caches pages to disk. As a result, when a request comes in for domain.com, the rewrite rules send out the cached file, which is what makes it fast. The down side is that by bypassing WordPress the canonical URL functionality that would redirect to https://www.domain.com is also bypassed.
The ideal fix would be to add the host name to the page cache root. Instead of wp-content/w3tc/pgcache/, use wp-content/w3tc/pgcache/{HOSTNAME}/. WP Super Cache does this and it works nicely – requests to domain.com are not served from the cached files for https://www.domain.com, so WordPress gets executed and redirects to the canonical URL, and there is no output to cache.
Any chance we could see this in W3 Total Cache?
Thanks!
John