(WIP) RFC-024: Cache #1156
jerrykingxyz
started this conversation in
RFC
Replies: 2 comments
-
Resurrecting this, it is a very big improvement for large projects that are still taking 10-20 seconds with Rspack. While we work on improving first build, having cache for subsequent builds would be a huge win. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Any thoughts on when rspack will support the file system caching, please? Working on a large project and this is a blocker to migrate from webpack. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Cache support for rspack.
Motivation
Cache can improve build speed.
Guide-level explanation
There are two parts of the configuration that are exposed to user.
Cache
Use
cache
field can config storage strategy.Snapshot
Use
snapshot
options decide how the file system snapshots are created and invalidated.Reference-level explanation
Storage
We need to create a trait to abstract storage operations. Both
memory cache
&filesystem cache
implement this trait.Rspack will create and save cache instance in compiler, and shared to compilation.
Snapshot
The snapshot checks whether a file has changed using a timestamp or hash.
Use cache
Because of swc ast & context can not be serialize, the build module stage will not be cache ast info.
Dev Stage
Support persistent storage
improve cache platform
Drawbacks
Nope
Prior art
#1111
Future possibilities
Nope
Beta Was this translation helpful? Give feedback.
All reactions