diff --git a/advagg.module b/advagg.module
index 79e11ba..3561744 100644
--- a/advagg.module
+++ b/advagg.module
@@ -666,7 +666,18 @@ function advagg_processor(&$variables) {
 
   // Try cache.
   if (variable_get('advagg_use_full_cache', ADVAGG_USE_FULL_CACHE)) {
-    $cid = 'advagg_processor:css:' . md5(serialize(array($css, $css_conditional_styles))) . ':' . $schema . ':' . variable_get('advagg_css_render_function', ADVAGG_CSS_RENDER_FUNCTION) . ':' . substr(variable_get('css_js_query_string', '0'), 0, 1);
+    // Build the cache ID
+    // md5 of the CSS input
+    // http or https
+    // hostname
+    // the js rendering function
+    // css/js query string
+    $cid = 'advagg_processor:css:'
+      . md5(serialize(array($css, $css_conditional_styles))) . ':'
+      . $schema . ':'
+      . $_SERVER['HTTP_HOST'] . ':'
+      . variable_get('advagg_css_render_function', ADVAGG_CSS_RENDER_FUNCTION) . ':'
+      . substr(variable_get('css_js_query_string', '0'), 0, 1);
     $cache = cache_get($cid, 'cache_advagg_bundle_reuse');
   }
   elseif (isset($cid)) {
@@ -706,7 +717,18 @@ function advagg_processor(&$variables) {
 
   // Try cache.
   if (variable_get('advagg_use_full_cache', ADVAGG_USE_FULL_CACHE)) {
-    $cid = 'advagg_processor:js:' . md5(serialize($js_code)) . ':' . $schema . ':' . variable_get('advagg_js_render_function', ADVAGG_JS_RENDER_FUNCTION) . ':' . substr(variable_get('css_js_query_string', '0'), 0, 1);
+    // Build the cache ID
+    // md5 of the JS input
+    // http or https
+    // hostname
+    // the js rendering function
+    // css/js query string
+    $cid = 'advagg_processor:js:'
+      . md5(serialize($js_code)) . ':'
+      . $schema . ':'
+      . $_SERVER['HTTP_HOST'] . ':'
+      . variable_get('advagg_js_render_function', ADVAGG_JS_RENDER_FUNCTION) . ':'
+      . substr(variable_get('css_js_query_string', '0'), 0, 1);
     $cache = cache_get($cid, 'cache_advagg_bundle_reuse');
   }
   elseif (isset($cid)) {
