Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(cache): Add cacheFilter option to limit asset caching #19363

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
Loading
from

Conversation

Vansh5632
Copy link
Contributor

Fixes: #19359

This PR introduces a feature by adding a new configuration option (cache.cacheFilter.maxAssetSize) to the filesystem cache system. It includes:

  • Modifications to IdleFileCachePlugin.js to filter assets based on size.
  • Updates to applyCacheDefaults in lib/config/defaults.js to set a default maxAssetSize of 2048 bytes.
  • Schema updates in Webpack’s configuration JSON to validate the new option.

Prevents large asset module data from bloating the filesystem cache.
Introduces a configurable  option
to skip caching large binary data, improving cache size and build performance
Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid sending feature requests before discussion, otherwise you lose your time.

This is not a universal solution and we should avoid them.

cacheFilter should be just a function and we should pass identifier and data to this function, so developer will write own behavior (it can be based on size, identifier/etc), other non official plugins can store binary assets too and current solution will not solve such problem

@Vansh5632
Copy link
Contributor Author

okay mistake from my side i will keep this in mind but what can be correct solution from your point of view i think we should implement this thing and add on some more things which you are telling

@alexander-akait
Copy link
Member

Just make it a function and pass identifier and data to this function

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

Successfully merging this pull request may close these issues.

Asset module binary files are stored in webpack cache
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.