Better caching for get_dirsize
|Reported by:||batmoo||Owned by:|
|Component:||Filesystem API||Keywords:||has-patch dev-feedback needs-unit-tests|
In a multisite install, when trying to determine whether a site has exceeded its storage quota, WordPress will scan through a blog's upload directory and sum up the file sizes, by running filesize against each one. With a large number of files, this can significantly slow down the upload process or certain portions of the Dashboard.
get_dirsize has transient caching in place but this is a single cache entry for all folders. It might be better if WordPress has a separate cache entry for each folder and was invalidated based on context so that get_dirsize does not need to be run constantly on older, unchanged directories as frequently.
Change History (20)
in reply to:
5 years ago
- Cc kpayne@… added
- Type changed from defect (bug) to enhancement
3 years ago
- Keywords close removed
- Milestone changed from Awaiting Review to Future Release
12 months ago
11 months ago
- Keywords has-patch dev-feedback needs-unit-tests added; needs-patch removed