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

Any opposition to making cacheDirectory default true? #199

Closed
STRML opened this issue Jan 12, 2016 · 9 comments
Closed

Any opposition to making cacheDirectory default true? #199

STRML opened this issue Jan 12, 2016 · 9 comments
Labels

Comments

@STRML
Copy link
Contributor

STRML commented Jan 12, 2016

Been fielding a lot of questions from webpack users about slow builds; enabling cacheDirectory usually helps a lot. Is there a good reason to keep it disabled by default?

@Couto
Copy link
Member

Couto commented Jan 15, 2016

My reasoning was that is not something that loaders do by default (in fact I only know babel-loader that has such option), and as such, users might not be aware of that option.

I'm not against turning it on by default, but I feel that it might be dangerous.

@Couto Couto added the question label Jan 15, 2016
@STRML
Copy link
Contributor Author

STRML commented Jan 15, 2016

Understood - can you think of any instances in which it would be dangerous to do? Webpack (unfortunately) doesn't do file cache now but I believe it will in the near future of the 2.x branch. Plenty of other build tools do caching to /tmp, including npm itself.

Potentially we could run into a disk space issue, but properly-configured systems should be tmpreaping or something similar. Perhaps {cacheDirectory: NODE_ENV !== 'production'}?

@Couto
Copy link
Member

Couto commented Jan 15, 2016

Any ETA for Webpack 2.x ? It might not be worth the effort if they're planning to release it soon.
Otherwise, I'm open to PR ;) And disabling the cache when NODE_ENV is production sounds a safe measure!

@camjc
Copy link

camjc commented Jun 8, 2016

Just realised that this option existed and got a big perf boost.

There will always be people using this package without reading through the readme (In my case I inherited the project, and I think the original was built using a scaffolder anyway).

Seems like this should be performant by default if possible.

@STRML
Copy link
Contributor Author

STRML commented Jun 8, 2016

Yeah I really don't see any reason to not make this default to /tmp.
On Jun 7, 2016 7:59 PM, "Cameron Chamberlain" notifications@github.com
wrote:

Just realised that this option existed and got a big perf boost.

There will always be people using this package without reading through the
readme (In my case I inherited the project, and I think the original was
built using a scaffolder anyway).

Seems like this should be performant by default if possible.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#199 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABJFP9o6i0HEFBqMj0tZz4mPfaC52_nHks5qJhPpgaJpZM4HDO1C
.

@kristianmandrup
Copy link

What are the use cases of cacheDirectory vs cacheIdentifier ?? can they be used in combination? See #324

@vjpr
Copy link

vjpr commented May 10, 2018

cacheDirectory defaulting to /tmp is a bad idea. So many issues caused by cache not being invalidated when it needs to be. Developer should always know exactly where their cache is.

@loganfsmyth
Copy link
Member

I don't think I'm in favor of this. The cache doesn't invalidate well in all cases and means you're writing a bunch of files to disk that you might not actually want, like if you're doing a build for production.

@choskim
Copy link

choskim commented Sep 20, 2018

@loganfsmyth, are there any downsides of setting cacheDirectory to true for only development? From my perspective, there's two potential problems. The first, that you mentioned, is cache invalidation. Do you have any examples of when this doesn't get done correctly? The second, when, if at all, does the cache get cleared?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants