# Understanding "rejecting cache file …"

**URL:** https://discourse.julialang.org/t/understanding-rejecting-cache-file/55127
**Category:** New to Julia
**Created:** [February 12, 2021, 9:05am UTC](https://discourse.julialang.org/t/understanding-rejecting-cache-file/55127 "2021-02-12T09:05:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dapz](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@dapz](https://discourse.julialang.org/u/dapz)
#### Post date: [February 12, 2021, 9:05am UTC](https://discourse.julialang.org/t/understanding-rejecting-cache-file/55127/1 "2021-02-12T09:05:13Z")

</div>

Hi, I have a package that I develop locally and which has a few dependencies, and I don’t understand why I get so many debug messages “rejecting cache file …” when loading it (which, I guess, also increases the loading time). I precise that this happens even when I do not modify anything. E.g.: I load julia, I load my module with “using MyModule” in the REPL, I exit the REPL, I re-enter the REPL, I re-run “using MyModule”… and plenty of such messages. Is basically see 3 types of such messages:

1. `┌ Debug: Rejecting cache file […].ji because it is for file […]SomePackage/SomeHash/src/[…]) not file […]SomePackage/SomeOtherHash/src/[…] └ @ Base loading.jl:1480`
2. `┌ Debug: Rejecting cache file […] because module […] is already loaded and incompatible. └ @ Base loading.jl:1448`
3. `┌ Debug: Rejecting cache file […].ji because dependency […] not found. └ @ Base loading.jl:1454`

Could someone explain me what is likely to trigger such messages? I’m not sure to really understand what it means. I understand that in a “normal” workflow, loading other packages before/after can invalidate some cached files, but here I don’t get it. I tried to stay in the basic environment for simplicity, and not to load anything else. I usually have in my startup file “using Statistics, LinearAlgebra, Revise”, but I even tried to remove that and it does not seems to change anything. (And I’m using julia 1.5.3)

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [February 12, 2021, 10:03am UTC](https://discourse.julialang.org/t/understanding-rejecting-cache-file/55127/2 "2021-02-12T10:03:44Z")

</div>

You could first try to clean out `.julia/v1.5/compiled`. Second, are you doing a bunch of manipulations with `JULIA_LOAD_PATH` in your code?

---

<div class="post-metadata">

### Author: ![dapz](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@dapz](https://discourse.julialang.org/u/dapz)
#### Post date: [February 12, 2021, 11:57am UTC](https://discourse.julialang.org/t/understanding-rejecting-cache-file/55127/3 "2021-02-12T11:57:24Z")

</div>

I’m not manipulating `JULIA_LOAD_PATH` at all, but indeed after cleaning all the files in `.julia/v1.5` it seems that I don’t have problems anymore. Is it expected that we might have to do this manually from time to time? Is there still a reason why recompiling one time is not sufficient in this setting? Thanks!

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [February 12, 2021, 3:05pm UTC](https://discourse.julialang.org/t/understanding-rejecting-cache-file/55127/4 "2021-02-12T15:05:51Z")

</div>

> [@dapz](#):
>
> Is it expected that we might have to do this manually from time to time?

Not really expected, but I’ve noticed that it seems to help for some reason…

---

<div class="post-metadata">

### Author: ![anandj](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@anandj](https://discourse.julialang.org/u/anandj)
#### Post date: [November 15, 2022, 2:57pm UTC](https://discourse.julialang.org/t/understanding-rejecting-cache-file/55127/5 "2022-11-15T14:57:35Z")

</div>

I’d really like to understand more about this: [Repeated Pkg precompilation and loading precompilation for the same package version · Issue #2761 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/2761) seems like a very similar issue.

I feel like I must be doing something wrong because I hit this pretty much any time I do `using`, even after `]precompile`.

I do not know why my precompile caches are getting invalidated and/or rejected. What should I do to further investigate how this happens? Is it Revise? It seems to happen even if I disable startup. Often it seems like its Parser

I just deleted my compiled folder and somehow I’ve already caused Pkg to get invalidated.
