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

[3.1] File filtering caching #3409

Merged
merged 1 commit into from
Mar 22, 2021
Merged

[3.1] File filtering caching #3409

merged 1 commit into from
Mar 22, 2021

Conversation

jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented Mar 22, 2021

When you do $assetContainer->files() it would get the raw file listing which includes stuff in .meta, .gitignore, .DS_Store, etc and it would filter those out. It would do it every time you called files().

Users were reporting it would be slow when they have lots of assets. That makes sense, because if you have 5,000 assets, you'll have 5,000 hidden meta files. If you have all those assets spread out through many directories, then it'll also have all those directories. That'll give you over 10,000 items to filter though. Makes sense why it's slow.

This PR will make it so it only performs the filtering once per request by caching the listing to a property.

@jasonvarga jasonvarga merged commit 7edce9a into master Mar 22, 2021
@jasonvarga jasonvarga deleted the fix/cache-file-filtering branch March 22, 2021 18:35
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.

None yet

1 participant