diff --git a/bin/compile b/bin/compile
index d7b639ce31c408fae4c111ebf61c0563978d7658..69ea53fb391f46d94c8adb2a2ea447836e644fb1 100755
--- a/bin/compile
+++ b/bin/compile
@@ -145,16 +145,16 @@ bpwatch start clear_old_venvs
   [ -d $CACHE_DIR/$VIRTUALENV_LOC ] && rm -fr $CACHE_DIR/.heroku/venv $CACHE_DIR/.heroku/src
 bpwatch stop clear_old_venvs
 
-cd $CACHE_DIR
-rm !($WHITELISTED_CACHE_ENTRIES)
-
-cd $BUILD_DIR
-
 # Restore old artifacts from the cache.
 bpwatch start restore_cache
   cp -R $CACHE_DIR/$CACHED_DIR . &> /dev/null || true
 bpwatch stop restore_cache
 
+# Cleanup what's in the cache.
+cd $CACHED_DIR
+rm !($WHITELISTED_CACHE_ENTRIES)
+cd $BUILD_DIR
+
 set +e
 # Create set-aside `.heroku` folder.
 mkdir .heroku &> /dev/null