# Analysis cache detail usage

**URL:** <https://community.sonarsource.com/t/analysis-cache-detail-usage/24632>\
**Category:** SonarQube Server / Community Build\
**Tags:** cfamily\
**Created:** [May 14, 2020, 6:30am UTC](https://community.sonarsource.com/t/analysis-cache-detail-usage/24632 "2020-05-14T06:30:49Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![mpaladin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mpaladin/32/118_2.png) [@mpaladin](https://community.sonarsource.com/u/mpaladin)\
**Post date:** [May 14, 2020, 2:14pm UTC](https://community.sonarsource.com/t/analysis-cache-detail-usage/24632/6 "2020-05-14T14:14:40Z")

</div>

Hi @Kamal_Chandra,

never give anything as implicit, SonarSource supports \> 20 languages and there are tens of plugins available in the marketplace.

> [@Kamal\_Chandra](#):
>
> Question 1:  
> Is analysis cache per workspace? That is does it rely on path where the workspace is checked out?  
> It seems like the case for me. So locally I have master checked out in 2 locations and I am using the same cache path for both analysis. There are no hits between them when switching from one to another. Note: It is exact same source code. And if I work on one workspace I get 100% hit.

The cache depends on the absolute path too, checkouts at different paths are not supposed to use the same cache. Even more, cache should not be uses for parallel analysis.

> [@Kamal\_Chandra](#):
>
> Question 2:  
> The above issue will cause problems with PR on Jenkins and branch builds as they are checked out at different locations. What is the best approach to handle cache and reuse between different locations of source tree?

You should look at having a stable checkout path, i.e. on `/tmp`.

> [@Kamal\_Chandra](#):
>
> Question 3:  
> I use sonar.branch.name for all my build types and use the same cache for all build type on Jenkins. When I say build type I mean master, branch build and pull requests. ie. on Jenkins master build sonar.branch.name=master and for PR sonar.branch.name=PR-123 and branch build sonar.branch.name=branchname. Is this the way to do it to share the cache across from master to PR to branch builds?

Having only master build updating cache and PRs copying it from master without using it is a good solution. (You may be interested by this topic [SonarCFamily Cache Question](https://community.sonarsource.com/t/sonarcfamily-cache-question/21288))

---

_[View the full topic](https://community.sonarsource.com/t/analysis-cache-detail-usage/24632)._
