Incorporate caching logic fixes from robustness_drupal repo