[wp-trac] [WordPress Trac] #19879: Better caching for get_dirsize

WordPress Trac noreply at wordpress.org
Tue Aug 27 12:05:29 UTC 2013


#19879: Better caching for get_dirsize
-------------------------------+------------------------------
 Reporter:  batmoo             |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Multisite          |     Version:  3.3.1
 Severity:  normal             |  Resolution:
 Keywords:  2nd-opinion close  |
-------------------------------+------------------------------

Comment (by nacin):

 Replying to [comment:8 jeremyfelt]:
 > In [21387], `get_space_used()` was introduced to allow for an alternate
 method of checking used space to work via filter. I believe this takes
 care of the original issue.

 While it allows someone to do their own caching, this is still a bit lame.

 One thing we could do would be to remove the timeout. The dirsize_cache
 transient is invalidated in wp_handle_upload() (though not
 wp_handle_sideload()) and wp_delete_attachment(). If we're confident in
 this, we should be able to use the transient as long as it exists.

 It doesn't help with repeated invalidations followed by repeated recursive
 directory searches, but it'll at least lessen the number of times the
 directory is recursed for no reason at all.

 > When that was introduced, it started passing the directory to check via
 `wp_upload_dir()` rather than `BLOGUPLOADDIR`, which theoretically should
 mean nice things for checking directory sizes in smaller pieces.

 `BLOGUPLOADDIR` contained a path to a site's individual `/files/` folder,
 rather than all sites. So no change here.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/19879#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list