Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Persistent Cache support #5658

Open
pushkargupta9807 opened this issue Feb 18, 2024 · 11 comments
Open

[Feature]: Persistent Cache support #5658

pushkargupta9807 opened this issue Feb 18, 2024 · 11 comments
Assignees
Labels
feat New feature or request stale

Comments

@pushkargupta9807
Copy link

What problem does this feature solve?

Faster warm starts for applications.

Currently the warm starts with webpack are slightly better than the cold starts with rspack. This is preventing us to move to rspack for local development. This support of persistent cache is a must have to onboard developers for their local development.

What does the proposed API of configuration look like?

https://webpack.js.org/configuration/cache/

@pushkargupta9807 pushkargupta9807 added feat New feature or request pending triage The issue/PR is currently untouched. labels Feb 18, 2024
@jerrykingxyz jerrykingxyz self-assigned this Feb 19, 2024
@jerrykingxyz jerrykingxyz removed the pending triage The issue/PR is currently untouched. label Feb 19, 2024
Copy link

stale bot commented Apr 19, 2024

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the stale label Apr 19, 2024
@NetherGranite
Copy link

Bump 🙂

@pushkargupta9807
Copy link
Author

Bump :)

@woshirubbish
Copy link

Bump

1 similar comment
@huhuaaa
Copy link

huhuaaa commented May 31, 2024

Bump

@stale stale bot removed the stale label May 31, 2024
@childrentime
Copy link

@jerrykingxyz I think when solving this problem, we can conveniently add remote caching functionality. https://turbo.build/repo/docs/core-concepts/remote-caching

@hardfist
Copy link
Contributor

@jerrykingxyz I think when solving this problem, we can conveniently add remote caching functionality. turbo.build/repo/docs/core-concepts/remote-caching

this may depend on portable persistent cache which is another feature

Copy link

stale bot commented Oct 11, 2024

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added stale and removed stale labels Oct 11, 2024
@slorber
Copy link

slorber commented Nov 19, 2024

Hi @jerrykingxyz , just saw your RFCs here:

I'm not totally able to understand the design, but just wanted to make sure that you consider supporting these f:

Example pseudo-code from Docusaurus building localized documentation, but I guess the same could be similar for Rspress:

function compile(configs: Configuration[]): Promise<void> {
  return new Promise((resolve, reject) => {
    const compiler = Rspack(configs);
    compiler.run(/* ... */);
  });
}

const locales = ["en", "fr", "de"];

// sequential (on purpose)
for (locale of locales) {
  await compile([
    getConfig({ server: true, locale }),
    getConfig({ server: false, locale })
  ]);
  await runSSG(locale);
}

We are compiling 3 localized apps in 2 variants (client/server). The localized apps share a lot of code in common, apart the content itself (MDX).

My ideal expectations for a greatly optimized caching system (for both memory/persistent)

// Slower on cold builds
compile(clientConfig)

// A bit faster since it can reuse some of the client config cache (memory or persistent)
compile(serverConfig)

// Fastest since it can reuse server config cache
compile(serverConfig)
// Faster than compiling each config using cold caches
compile([clientConfig, serverConfig])
// Slower on cold builds
compile(french);

// A bit faster since it can reuse some of the french config cache (memory or persistent)
compile(english)

// Fastest since it can reuse english config cache
compile(english)

Does this make sense?


What didn't work well for us in how Webpack designed its persistent cache is that when running sequential compilations, the latest compilation was somehow overriding all the previous ones, instead of having a way to "append" to the persistent cache.

For example:

// Cold build => slow
compile(french)

// Warm build but different locale => decent amount of cache hits => a bit faster 
compile(english)

// Warn build with the exact same locale as last compilation => many cache hits => fastest 🎉
compile(english)

// Warm build with different locale => Unfortunately not as fast as we hoped! 😭
compile(french)

@jerrykingxyz
Copy link
Contributor

@slorber The current design of rspack persistent cache does not support shared cache with different configurations. For your needs, the configuration and conclusions on rspack persistent cache are consistent with those of webpack.

Copy link

stale bot commented Jan 19, 2025

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the stale label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request stale
Projects
None yet
Development

No branches or pull requests

8 participants