# \[IDE 2.3.4\] Change of cache directory?

**URL:** <https://forum.arduino.cc/t/ide-2-3-4-change-of-cache-directory/1332455>\
**Category:** IDE 2.x\
**Created:** [December 15, 2024, 2:48pm UTC](https://forum.arduino.cc/t/ide-2-3-4-change-of-cache-directory/1332455 "2024-12-15T14:48:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [December 15, 2024, 2:48pm UTC](https://forum.arduino.cc/t/ide-2-3-4-change-of-cache-directory/1332455/1 "2024-12-15T14:48:04Z")

</div>

I had a shortcut in windows pointing to the cache `C:\Users\bugge\AppData\Local\Temp\arduino`  
Since IDE 2.3.4, the location seems to have changed to `C:\Users\bugge\AppData\Local\arduino`

1. Have I been wrong all the time?
2. Was the change intentional or by accident?

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [December 15, 2024, 4:30pm UTC](https://forum.arduino.cc/t/ide-2-3-4-change-of-cache-directory/1332455/2 "2024-12-15T16:30:02Z")

</div>

I think I heard of another folder change as well. Perhaps the release notes make mention of it.

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [December 15, 2024, 5:48pm UTC](https://forum.arduino.cc/t/ide-2-3-4-change-of-cache-directory/1332455/3 "2024-12-15T17:48:26Z")

</div>

I could not find release notes (except for the info in the pinned topic).

I also could not find it reading through [Comparing 2.3.3...2.3.4 · arduino/arduino-ide · GitHub](https://github.com/arduino/arduino-ide/compare/2.3.3...2.3.4); I did however did not dig through all the links in there.

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [December 15, 2024, 6:20pm UTC](https://forum.arduino.cc/t/ide-2-3-4-change-of-cache-directory/1332455/4 "2024-12-15T18:20:08Z")

</div>

Since it's not something the average user would care about maybe they just didn't bother documenting it.

---

<div class="post-metadata">

**Author:** ![KurtE](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kurte/32/1246572_2.png) [@KurtE](https://forum.arduino.cc/u/KurtE)\
**Post date:** [December 16, 2024, 12:45pm UTC](https://forum.arduino.cc/t/ide-2-3-4-change-of-cache-directory/1332455/5 "2024-12-16T12:45:29Z")

</div>

There have been cases where users do care. Like when wants to access the directory, like maybe look at map file, or when the cached data gets messed up, and instructions have been to go to that directory and erase it…

Also before the disk cleanup utilities would clean it up, which was a blessing and a curse. As sometimes it would do so while sketch still open.

---

<div class="post-metadata">

**Author:** ![kenb4](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kenb4](https://forum.arduino.cc/u/kenb4)\
**Post date:** [December 17, 2024, 12:19am UTC](https://forum.arduino.cc/t/ide-2-3-4-change-of-cache-directory/1332455/6 "2024-12-17T00:19:58Z")

</div>

[This change](https://github.com/arduino/arduino-cli/commit/863c1ec365af2cf90ee41f6fcadfa675e5d61704), released with `arduino-cli` v1.1.1, appears to be intentional

```txt
* Use default user's cache dir instead of tmp for build cache

```

which is [this addition in `internal/cli/configuration/configuration.go`](https://github.com/arduino/arduino-cli/commit/863c1ec365af2cf90ee41f6fcadfa675e5d61704#diff-f6fd4abbb8217b0b3ffc8591ffe57902efaca3117b9e718dc9ffda62e3cc243c) further down

```go
// getDefaultBuildCacheDir returns the full path to the default build cache folder
func getDefaultBuildCacheDir() string {
	var cacheDir *paths.Path
	if p, err := os.UserCacheDir(); err == nil {
		cacheDir = paths.New(p)
	} else {
		// fallback to /tmp
		cacheDir = paths.TempDir()
	}
	return cacheDir.Join("arduino").String()
}

```

[`os.UserCacheDir`](https://pkg.go.dev/os#UserCacheDir) says

> [@](#):
>
> UserCacheDir returns the default root directory to use for user-specific cached data. Users should create their own application-specific subdirectory within this one and use that.
> 
> On Unix systems, it returns $XDG\_CACHE\_HOME as specified by [https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) if non-empty, else $HOME/.cache. On Darwin, it returns $HOME/Library/Caches. On Windows, it returns %LocalAppData%. On Plan 9, it returns $home/lib/cache.

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [December 17, 2024, 9:36am UTC](https://forum.arduino.cc/t/ide-2-3-4-change-of-cache-directory/1332455/7 "2024-12-17T09:36:38Z")

</div>

Thanks @kenb4 for the link.

@KurtE, that's one of the reasons. And as long as the IDE does not have a "clean build" option, I use it to make sure that I can build from scratch.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [December 17, 2024, 10:33am UTC](https://forum.arduino.cc/t/ide-2-3-4-change-of-cache-directory/1332455/8 "2024-12-17T10:33:50Z")

</div>

Thanks @kenb4!

This change should provide a significant performance improvement for Linux and macOS users. Those operating systems automatically clear the temporary folder, which would cause the loss of the cached compiled core, library, and sketch objects and thus a full recompile when the cache was stored there. By moving it to the cache folder, it allows Arduino CLI to exclusively manage its cache (it does have its own [automatic clean up mechanism](https://arduino.github.io/arduino-cli/dev/configuration/#:~:text=compilations_before_purge)).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [June 15, 2025, 10:34am UTC](https://forum.arduino.cc/t/ide-2-3-4-change-of-cache-directory/1332455/9 "2025-06-15T10:34:16Z")

</div>

Closed on June 15, 2025, 10:34am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
