Can docker hub automated builds cache NPM

Currently we build docker images on our own infrastructure and can cache NPM packages. This speeds up the build time in case the package.json/package-lock.json changes (otherwise it should use a cached layer).

I cannot find in the documentation if:

  1. Docker hub automated builds uses cached layers of previous versions of the Docker image?
  2. Is there functionality to keep a cache accross builds?

Does anyone know this? For (1) I only found a Stack Exchange question that was answered in 2024 (dockerhub - Does hub.docker.com use "--no-cache" for automated builds? - Stack Overflow)

Docker build supports storing the cache in a registry like Docker Hub