Okay! You filed this under the SonarQube category rather than SonarCloud, which is why I was confused.
Here’s the deal – while the cache works with pull request analysis, it does not work yet with branch analysis.
It works with PR analysis because we only see the files belonging to the PR and the others are discarded. This is what we’re calling “incremental analysis” – and what the cache is designed for today.
For branch analysis this is different: an analysis of the main branch shows the analysis for the entire branch. We haven’t gotten to the point of being able to confidently merge existing analysis results and new analysis results and display that as a new analysis, which would be required for the main branch.
Thus, when you analyze a main branch, all files are ineligible to use the cache.
It’s on the list, but we prioritized PR analysis because developers typically have less time to wait for a PR analysis than for a main branch analysis.