Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.2k
feat: add cache.storeFilter for filtering cached assets#19577
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| exportinterfaceMemoryCacheOptions{ | ||
| /** | ||
| * Additionally cache computation of modules that are unchanged and reference only unchanged modules. | ||
| * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I didn't change this line. This was added automatically byyarn run fix:special
| /** | ||
| * A function to filter which cache entries should be stored. Return false to skip storing a cache entry. | ||
| */ | ||
| storeFilter?:(identifier:string,data:any)=>boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Function signature is similar to the one suggested by@alexander-akaithere but I'm not sure if there are any use-cases for filtering ondata.
Need input from the maintainers here. If it isn't required, I'll go ahead and remove thedata parameter.
alexander-akait left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It should work for memory cache too, also please add test cases
cseas commentedJun 9, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@alexander-akait I've added the storeFilter property to MemoryCachePlugin as well. Also added unit tests for both IdleFileCachePlugin and MemoryCachePlugin. ✅ |
Uh oh!
There was an error while loading.Please reload this page.
Fixes#19359
What kind of change does this PR introduce?
Add a new config option
cache.storeFileswhich gives the users an option to configure filtering for which assets should be excluded from cache.Did you add tests for your changes?
Yes
Does this PR introduce a breaking change?
No
What needs to be documented once your changes are merged?
cache.type: 'memory'not allowing additional configuration.