The caching layer nor the database caching implementation respect https through the system. This is important because parts of Drupal (core included) generate absolute URLs. These URLs can be cached with a protocol of http:// and then embedded in a page (through nested caching) where the protocol should be https://.
This contains a Drupal database caching alternative that attempts to respect caching via https. The default Drupal database cache doesn't think about https (aside from the page cache). That means you could have html cached with absolute urls generated by Drupal using http in caches like the block or filter cache. This data can then bubble up into the https version of the page cache.
This cache is a small layer of logic on top of the current database cache. So, if changes happen there (non-API changes) they will be inherited in this as well.
How to use this cache
In your settings.php file include this cache backend:
$conf['cache_backends'][] = 'sites/all/modules/database-cache-respecting-https/db.cache.inc';
Then set the default caching class to the one included here.
$conf['cache_default_class'] = 'DrupalDatabaseCacheResepectHTTPS';
The cache includes a whitelist of cache bins (tables) that skip checking and
enforcing https. You can alter this list by adding a variable to your settings.php
file like:
<?php