diff --git a/appveyor.yml b/appveyor.yml
index 71558077c..55e41a76b 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -5,6 +5,7 @@ environment:
     WIXBIN: "c:\\Program Files (x86)\\WiX Toolset v3.11\\bin"
     CABAL_STORE: "C:\\cs"
     CABAL_PACKAGE_DB: "%CABAL_STORE%\\ghc-%GHC_MINOR_VERSION%\\package.db"
+    APPVEYOR_SAVE_CACHE_ON_ERROR: true
     # Override the temp directory to avoid sed escaping issues
     # See https://github.com/haskell/cabal/issues/5386
     TMP: "c:\\tmp"