[wp-trac] [WordPress Trac] #33241: wp_get_http should stream directly to the file

WordPress Trac noreply at wordpress.org
Mon Aug 3 12:33:50 UTC 2015


#33241: wp_get_http should stream directly to the file
-------------------------+-----------------------------
 Reporter:  rmccue       |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  HTTP API     |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 Right now, `wp_get_http` does a regular HTTP request via WP_Http, then
 saves out to a file. This necessitates loading the entire file into
 memory, then saving it out, which can massively increase the memory usage.
 This is important in imports (the only place I can see where the function
 is used).

 Instead, we should use WP_Http's native file streaming functionality,
 which pushes the bytes into the file as we go, rather than loading into
 memory.

 In addition, I'd propose we deprecate `wp_get_http`, and anything using it
 (notably WordPress Importer) should use the normal HTTP functions.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33241>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list