After following Jon’s tips on DIY docker layer caching at Notes on caching Docker layers in CircleCI, I found out our cache is not used by Docker whenever the base image is updated on Docker Hub.
So this is how I deal with the issue by querying Docker Hub API on the ID of all base images used in the dockerfile: https://anonoz.github.io/tech/2018/06/17/circleci-docker-caching.html
Ideas, suggestions are highly appreciated. Thanks!