Commit 8fb5b8a
authored
Optimizing build cache step (#1395)
While looking for ways to optimize/shave off time from our builds, I was
brought back to [this
ticket](https://app.asana.com/1/90955849329269/inbox/1211294560690016/item/1212009520590921/story/1212029899178754).
This caching step didn't make any sense to me so I delved into it.
Essentially, this step was creating a cache key whose name was a mix
between a hash of our package-lock file and a hash of all of our (70k+)
mdx files (which would take 2-3 min to process). This key would be used
to pull up a cached version of the content we have in ~/.npm and
/.next/cache during the github runner process. The content in those
folders are just downloaded packages, compliled js/ts files, and other
things for nextjs optimization.
If a single mdx file changed, it would just invalidate the cache (even
though the cache was totally good to use), and cause us to run npm
install again, so we never really had the proper benefit of this cache
in the first place.
This PR simplifies and narrows the scope of the files we actually care
about caching the changes for. Included changes in both the
build-preview process and the deploy-udr step.File tree
10 files changed
+23
-39
lines changed- .github/workflows
- scripts
- prebuild
- utils
10 files changed
+23
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
| |||
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 115 | + | |
| 116 | + | |
122 | 117 | | |
123 | 118 | | |
124 | 119 | | |
| |||
187 | 182 | | |
188 | 183 | | |
189 | 184 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | 185 | | |
202 | 186 | | |
203 | 187 | | |
| |||
206 | 190 | | |
207 | 191 | | |
208 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
209 | 199 | | |
210 | 200 | | |
211 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 33 | + | |
| 34 | + | |
41 | 35 | | |
42 | 36 | | |
43 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments