diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java b/src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java
index 4f2a33c..7170836 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java
@@ -267,7 +267,11 @@
     }
     Map<String, String> usedClientEnv = computeUsedClientEnv(action, clientEnv);
     ActionCache.Entry entry =
-        new ActionCache.Entry(action.getKey(), usedClientEnv, action.discoversInputs());
+        actionCache.newEntry(action.getKey(), usedClientEnv, action.discoversInputs());
+    if (entry == null) {
+      // Action cache is disabled, don't generate digests.
+      return;
+    }
     for (Artifact output : action.getOutputs()) {
       // Remove old records from the cache if they used different key.
       String execPath = output.getExecPathString();
@@ -386,12 +390,19 @@
       // Compute the aggregated middleman digest.
       // Since we never validate action key for middlemen, we should not store
       // it in the cache entry and just use empty string instead.
-      entry = new ActionCache.Entry("", ImmutableMap.<String, String>of(), false);
-      for (Artifact input : action.getInputs()) {
-        entry.addFile(input.getExecPath(), metadataHandler.getMetadataMaybe(input));
+      entry = actionCache.newEntry("", ImmutableMap.<String, String>of(), false);
+      if (entry != null) {
+        for (Artifact input : action.getInputs()) {
+          entry.addFile(input.getExecPath(), metadataHandler.getMetadataMaybe(input));
+        }
       }
     }
 
+    // Action cache is disabled, skip the digest.
+    if (entry == null) {
+      return;
+    }
+
     metadataHandler.setDigestForVirtualArtifact(middleman, entry.getFileDigest());
     if (changed) {
       actionCache.put(cacheKey, entry);
diff --git a/src/main/java/com/google/devtools/build/lib/actions/cache/ActionCache.java b/src/main/java/com/google/devtools/build/lib/actions/cache/ActionCache.java
index 1e123e5..0cdec63 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/cache/ActionCache.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/cache/ActionCache.java
@@ -59,6 +59,13 @@
   void remove(String key);
 
   /**
+   * Constructs an {@code Entry}.
+   * @return new {@code Entry} or null if the cache is disabled.
+   */
+  @Nullable
+  Entry newEntry(String key, Map<String, String> usedClientEnv, boolean discoversInputs);
+
+  /**
    * An entry in the ActionCache that contains all action input and output
    * artifact paths and their metadata plus action key itself.
    *
diff --git a/src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java b/src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java
index a644000..1be6efa 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java
@@ -17,6 +17,7 @@
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
+import com.google.devtools.build.lib.actions.cache.ActionCache.Entry;
 import com.google.devtools.build.lib.concurrent.ThreadSafety.ConditionallyThreadSafe;
 import com.google.devtools.build.lib.profiler.AutoProfiler;
 import com.google.devtools.build.lib.util.Clock;
@@ -337,6 +338,11 @@
     }
   }
 
+  @Override
+  public Entry newEntry(String key, Map<String, String> usedClientEnv, boolean discoversInputs) {
+    return new Entry(key, usedClientEnv, discoversInputs);
+  }
+
   /**
    * @return action data encoded as a byte[] array.
    */
diff --git a/src/main/java/com/google/devtools/build/lib/actions/cache/StubActionCache.java b/src/main/java/com/google/devtools/build/lib/actions/cache/StubActionCache.java
index 9e1cdd3..f1d8c8b 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/cache/StubActionCache.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/cache/StubActionCache.java
@@ -15,6 +15,7 @@
 package com.google.devtools.build.lib.actions.cache;
 
 import java.io.PrintStream;
+import java.util.Map;
 
 /** An {@link ActionCache} which does not store entries. */
 public class StubActionCache implements ActionCache {
@@ -37,4 +38,9 @@
 
   @Override
   public void dump(PrintStream out) {}
+  
+  @Override
+  public Entry newEntry(String key, Map<String, String> usedClientEnv, boolean discoversInputs) {
+    return null;
+  }
 }
diff --git a/src/test/java/com/google/devtools/build/lib/actions/util/ActionCacheTestHelper.java b/src/test/java/com/google/devtools/build/lib/actions/util/ActionCacheTestHelper.java
index eddd94d..59f14d1 100644
--- a/src/test/java/com/google/devtools/build/lib/actions/util/ActionCacheTestHelper.java
+++ b/src/test/java/com/google/devtools/build/lib/actions/util/ActionCacheTestHelper.java
@@ -14,8 +14,9 @@
 package com.google.devtools.build.lib.actions.util;
 
 import com.google.devtools.build.lib.actions.cache.ActionCache;
-
+import com.google.devtools.build.lib.actions.cache.ActionCache.Entry;
 import java.io.PrintStream;
+import java.util.Map;
 
 /**
  * Utilities for tests that use the action cache.
@@ -23,18 +24,31 @@
 public class ActionCacheTestHelper {
   private ActionCacheTestHelper() {}
 
-  /** A cache which does not remember anything.  Causes perpetual rebuilds! */
+  /** A cache which does not remember anything. Causes perpetual rebuilds! */
   public static final ActionCache AMNESIAC_CACHE =
-    new ActionCache() {
-      @Override
-      public void put(String fingerprint, Entry entry) {}
-      @Override
-      public Entry get(String fingerprint) { return null; }
-      @Override
-      public void remove(String key) {}
-      @Override
-      public long save() { return -1; }
-      @Override
-      public void dump(PrintStream out) { }
-    };
+      new ActionCache() {
+        @Override
+        public void put(String fingerprint, Entry entry) {}
+
+        @Override
+        public Entry get(String fingerprint) {
+          return null;
+        }
+
+        @Override
+        public void remove(String key) {}
+
+        @Override
+        public long save() {
+          return -1;
+        }
+
+        @Override
+        public void dump(PrintStream out) {}
+
+        @Override
+        public Entry newEntry(String key, Map<String, String> env, boolean discoversInputs) {
+          return new Entry(key, env, discoversInputs);
+        }
+      };
 }
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java b/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java
index 2eecace..ea4d53d 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java
@@ -40,6 +40,7 @@
 import com.google.devtools.build.lib.actions.Root;
 import com.google.devtools.build.lib.actions.TestExecException;
 import com.google.devtools.build.lib.actions.cache.ActionCache;
+import com.google.devtools.build.lib.actions.cache.ActionCache.Entry;
 import com.google.devtools.build.lib.actions.util.DummyExecutor;
 import com.google.devtools.build.lib.actions.util.TestAction;
 import com.google.devtools.build.lib.analysis.BlazeDirectories;
@@ -437,6 +438,11 @@
     public void dump(PrintStream out) {
       out.println("In-memory action cache has " + actionCache.size() + " records");
     }
+
+    @Override
+    public Entry newEntry(String key, Map<String, String> usedClientEnv, boolean discoversInputs) {
+      return new Entry(key, usedClientEnv, discoversInputs);
+    }
   }
 
   private static class SingletonActionLookupKey extends ActionLookupValue.ActionLookupKey {
