W3tc support ssl and help you to serve the assets with https.
You could set things up in your .htaccess (or nginx.conf) file to do these custom URL rewrites.
Maybe I will be able to help you.
W3 Total Cache write all its instructions at the beginning of .htaccess file.
We had also this kind of problem because our own instructions in .htaccess for the http:// ➜ https:// redirection appeared after W3 total Cache job.
So pages were constructed with http:// links if the case you asked the page in http:// and not https://; and only after, was switching to https://.
So go see your .htaccess file and put this code below at the beginning of your .htaccess file:
#######################################################
# INFOMANIAK
#######################################################
# REDIRECT HTTP TO HTTPS TO AVOID DUPLICATE CONTENT #
#######################################################
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule (.*) https://www.site.com/$1 [R=301,L]
######################################################
Hope it will work for you.