# Found empty cache on server. How to utilize Analysis cache?

**URL:** <https://community.sonarsource.com/t/found-empty-cache-on-server-how-to-utilize-analysis-cache/101454>\
**Category:** SonarQube Server / Community Build\
**Tags:** cfamily\
**Created:** [September 26, 2023, 11:33am UTC](https://community.sonarsource.com/t/found-empty-cache-on-server-how-to-utilize-analysis-cache/101454 "2023-09-26T11:33:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pcaparros](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pcaparros](https://community.sonarsource.com/u/pcaparros)\
**Post date:** [September 26, 2023, 11:33am UTC](https://community.sonarsource.com/t/found-empty-cache-on-server-how-to-utilize-analysis-cache/101454/1 "2023-09-26T11:33:46Z")

</div>

Must-share information (formatted with [Markdown](https://commonmark.org/help/)):

- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  - Sonarqube: 10.1
  - Scanner: 4.8.0.2856 & 5.0.1.3006
  - CFamily plugin version: 6.45.0.62016
  - Language being scanned: C++

- how is SonarQube deployed: zip
- what are you trying to achieve  
Utilize Server Analysis cache base on this documentation: [Analysis Cache](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/languages/c-family/#analysis-cache). There should be cache from the branch pipeline even when multiple scans where done after committing to the branch or the main branch(if no cache is found as the default cache)
- what have you tried so far to achieve this
  - Update scanner version.
  - Make compiler flags the same per scan
  - Commit changes and create a branch analysis. The server should have already cached the results but it doesn’t seem that way.
  - Make the checkout path the same for every runner.

Is there an expiry on the cached analysis in the server side? Or are there any good practices in utilizing caches beside mentioned here in this [link](https://community.sonarsource.com/t/sonarcfamily-cache-question/21288/3).

I have seen this work and it finds the cache in the server but sometimes it does not. Currently am testing this in branch analysis, and it doesn’t seem to find any cache even if it was scanned/analyzed multiple times via branch analysis. Is there a way to check if the cache was uploaded/updated in the server?

```auto
Found empty cache on server
....
Cache: 0/1240 hits, 12086268 bytes

```

I was hoping that the main branch’s cache will be used as said in the documentation.

---

<div class="post-metadata">

**Author:** ![aalvarez](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/aalvarez/32/39649_2.png) [@aalvarez](https://community.sonarsource.com/u/aalvarez)\
**Post date:** [September 27, 2023, 6:59am UTC](https://community.sonarsource.com/t/found-empty-cache-on-server-how-to-utilize-analysis-cache/101454/2 "2023-09-27T06:59:11Z")

</div>

Hello @pcaparros,

Could you share the output of the scanner with the debug switch (`-X`) ?

If you would like not to make public the contents of the logs, I can send you a PM so you can share them privately.
