Better caching for get_dirsize
|Reported by:||batmoo||Owned by:|
|Cc:||batmoo, djpaul@…, wordpress@…, kpayne@…|
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 (6)
- Cc kpayne@… added
- Type changed from defect (bug) to enhancement