diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0283e70f1f17facf82e0fe2264d6f8fac70e1f13..3f90a728cb634ef46eae8969609474387565764b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -28,8 +28,12 @@ build:gcc8:opt:
   artifacts:
     paths:
       - ${BUILDDIR}
-      - .ccache
     expire_in: 1 week
+  cache:
+    key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
+    paths:
+      - .ccache
+    
 
 build:gcc8:dbg:
   stage: build
@@ -43,8 +47,11 @@ build:gcc8:dbg:
   artifacts:
     paths:
       - ${BUILDDIR}
-      - .ccache
     expire_in: 1 week
+  cache:
+    key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
+    paths:
+      - .ccache
 
 check-formatting:
   stage: build
@@ -130,10 +137,10 @@ test_public_headers_build:
     BUILDDIR: build-opt
   script:
     - ci-utils/test_public_headers_build
-  artifacts:
+  cache:
+    key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
     paths:
       - .ccache
-    expire_in: 1 week
 
 # see https://gitlab.cern.ch/gitlabci-examples/deploy_eos for the details
 # of the configuration
diff --git a/ci-utils/build b/ci-utils/build
index 8ec848f45e8cd31e00b562aa2d399e381b3d3f14..99035e11841b3b4070c091170988f26b2ab06640 100755
--- a/ci-utils/build
+++ b/ci-utils/build
@@ -2,14 +2,7 @@
 
 . $(dirname $0)/env_setup.sh
 
-if [ -n "${CI}" ] ; then
-  url="${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_REF_NAME}/download?job=${CI_JOB_NAME}"
-  echo "downloading '${url}'"
-  curl -o artifacts.zip --location "${url}"
-  unzip -q artifacts.zip '.ccache/*' || true
-fi
-
-${LCG_release_area}/ccache/${CCACHE_VERSION}/${BINARY_TAG}/bin/ccache -z -M 1G
+${LCG_release_area}/ccache/${CCACHE_VERSION}/${BINARY_TAG}/bin/ccache -z -F 2000
 
 echo 'set(CMAKE_USE_CCACHE ON CACHE BOOL "")' >> cache_preload.cmake
 
diff --git a/ci-utils/test_public_headers_build b/ci-utils/test_public_headers_build
index 9d0a82983086be8f3d9a1568a46e798ff691342f..2477bab5225c5ec6b44e15ba629209e49bd2b080 100755
--- a/ci-utils/test_public_headers_build
+++ b/ci-utils/test_public_headers_build
@@ -2,12 +2,7 @@
 
 . $(dirname $0)/env_setup.sh
 
-if [ -n "${CI}" ] ; then
-  url="${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_REF_NAME}/download?job=${CI_JOB_NAME}"
-  echo "downloading '${url}'"
-  curl -o artifacts.zip --location "${url}"
-  unzip -q artifacts.zip '.ccache/*' || true
-fi
+${LCG_release_area}/ccache/${CCACHE_VERSION}/${BINARY_TAG}/bin/ccache -z -F 2000
 
 # make sure we do not re-run cmake
 find ${BUILDDIR} -type f -exec touch -d $(date +@%s) \{} \;