I have the same issue.
I guess the & reference is resolved at yaml loading (it’s YAML standard), then GitLab takes include and loads them.
Then the yaml loader can not resolve *cache because &cache is not defined in this file.
Now I’m looking at !reference (Optimize GitLab CI/CD configuration files | GitLab)