diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d84b12c2559fef733bd2a1a076b74faf39636f5c..e651d883dc8a8c5e07c94fc44c1efd19b9e79ab3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -32,6 +32,12 @@ build_ci_image:
     DOCKER_DRIVER: overlay2
     DOCKER_TLS_CERTDIR: ""
 
+cache: &global_cache
+  key: ${CI_PIPELINE_ID}
+  paths:
+    - .gradle/wrapper
+    - .gradle/caches
+  policy: pull
 
 .gradle-default:
   before_script:
@@ -41,11 +47,6 @@ build_ci_image:
   script:
     - echo "Overwrite me"
 
-  cache:
-    key: ${CI_PROJECT_ID}
-    paths:
-      - .gradle/
-
 .build:
   stage: build
   variables:
@@ -65,6 +66,9 @@ build_ci_image:
       - $apk_file
       - $metadata_file
       - $output_metadata
+  cache:
+    # inherit all global cache settings
+    <<: *global_cache
 
 test:
   extends: .gradle-default
@@ -79,6 +83,11 @@ test:
       junit: app/build/test-results/test**/TEST-*.xml
     paths:
       - $JACOCO_XML_LOCATION
+  cache:
+    # inherit all global cache settings
+    <<: *global_cache
+    # override the policy
+    policy: pull-push
 
 coverage:
   stage: visualize