# Super-slow build cache on Windows?

**URL:** <https://travis-ci.community/t/super-slow-build-cache-on-windows/4114>\
**Category:** Windows\
**Tags:** java\
**Created:** [July 8, 2019, 12:52pm UTC](https://travis-ci.community/t/super-slow-build-cache-on-windows/4114 "2019-07-08T12:52:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanySK](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/danysk/32/1399_2.png) [@DanySK](https://travis-ci.community/u/DanySK)\
**Post date:** [July 8, 2019, 12:52pm UTC](https://travis-ci.community/t/super-slow-build-cache-on-windows/4114/1 "2019-07-08T12:52:30Z")

</div>

Hi,  
is it to be expected that caching performance is **much** worse on Windows, compared to Linux and OSX?  
Can it be a consequence of Windows Defender? Can it get disabled before unpacking the caches?

---

<div class="post-metadata">

**Author:** ![tanzislam](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/tanzislam/32/2591_2.png) [@tanzislam](https://travis-ci.community/u/tanzislam)\
**Post date:** [August 29, 2019, 2:48am UTC](https://travis-ci.community/t/super-slow-build-cache-on-windows/4114/2 "2019-08-29T02:48:41Z")

</div>

See [this post](https://travis-ci.community/t/windows-builds-time-out-during-cache-restore/4642/4) for how to disable Windows Defender before cache download begins.

---

<div class="post-metadata">

**Author:** ![DanySK](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/danysk/32/1399_2.png) [@DanySK](https://travis-ci.community/u/DanySK)\
**Post date:** [August 29, 2019, 11:04am UTC](https://travis-ci.community/t/super-slow-build-cache-on-windows/4114/3 "2019-08-29T11:04:26Z")

</div>

@tanzislam thanks!  
I packed it into [Gravis-CI](https://github.com/DanySK/Gravis-CI)

```auto
env:
    # This is a convenience variable for shortening download commands
    - GRAVIS="https://raw.githubusercontent.com/DanySK/Gravis-CI/master/"
    # If you use Windows, you may want to disable Windows Defender. It slows down the builds
    # dramatically, also during cache setup. From a Tanzinul Islam's idea: http://bit.ly/348VPYS,
    # This work around disables it before caching
    - NO_WIN_DEFENDER=$(curl "${GRAVIS}.disable-windows-defender.sh" --output .no-defender.sh && source .no-defender.sh)

```

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [September 7, 2019, 3:27am UTC](https://travis-ci.community/t/super-slow-build-cache-on-windows/4114/4 "2019-09-07T03:27:58Z")

</div>

> [@Windows builds time out during cache restore](https://travis-ci.community/t/windows-builds-time-out-during-cache-restore/4642/7):
>
> I’ve tested @tanzislam’s idea with a fork of @bkimminich’s repo. Here’s the “happy” build: [https://staging.travis-ci.org/BanzaiMan/juice-shop/builds/747916](https://staging.travis-ci.org/BanzaiMan/juice-shop/builds/747916). Compared to the previous build [https://staging.travis-ci.org/BanzaiMan/juice-shop/builds/747914](https://staging.travis-ci.org/BanzaiMan/juice-shop/builds/747914) (which created the cache), the build time is 2 minutes shorter. With the production code with no tinkering with Windows Defender, [https://staging.travis-ci.org/BanzaiMan/juice-shop/builds/747918](https://staging.travis-ci.org/BanzaiMan/juice-shop/builds/747918) fails to expand the cache. See
