diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index e31322c..65c3d1d 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -1348,7 +1348,8 @@ function drupal_serve_page_from_cache(stdClass $cache) {
     header('Vary: Cookie');
   }
 
-  if ($page_compression) {
+  // If the page body is empty, it will be served uncompressed.
+  if ($page_compression && $cache->data['body']) {
     header('Vary: Accept-Encoding', FALSE);
     // If page_compression is enabled, the cache contains gzipped data.
     if ($return_compressed) {
