Automatically clear cache (Derived data iOS)

Hi,
I recently cached my DerivedData folder to speed up my iOS builds. My setup works and I’ve gained some time :ok_hand:

However, I don’t fully understand what is stored in DerivedData and I’m worried this folder could grow indefinitely. The risk is that the cache pull/push step become longer & longer…

I’ve seen on the docs that “cache expires after seven […] only if there’s no new build on that branch”.
→ We won’t fall in this scenario since we have a lot of build on my app.
I also see that you can manually delete the cache
→ good but I’m looking for a way to do that automatically if possible (& if cache is growing unexpectedly).

Do you know if this is possible ? Have you ever had issues with DerivedData growing indefinitely (I’m already currently at ~10GB)

Thanks :pray:

1 Like

Hi @mathieu.fedrigo

Thank you for reaching to Bitrise Support.

Can you let me know if this is still an issue? If so, would you mind sharing the build URL with support access enabled if you want us to look at the issue?

Hi.

Thanks for reaching out. :grinning:

I’m still unsure if I need to clear the CI cache and how to do it.
It’s not related to a specific build. (I don’t see how sharing a build URL would help you)

Let’s say I do need to clear it. This is what I’m doing currently:

  • disable cache_push on all of my builds
  • schedule a build each week with an env variable (SKIP_CACHE = true)
  • skip the cache_pull step if this env var is set to true
  • this weekly build is allowed to cache_push → it rebuilds the cache

What do you think about this method? Am I missing something ?

Thanks :pray: