Opened 10 years ago
Closed 9 years ago
#33241 closed enhancement (duplicate)
wp_get_http should stream directly to the file
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | HTTP API | Keywords: | has-patch |
Focuses: | Cc: |
Description
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.
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Also:
set_time_limit
(#21521)redirection
setting still applies. (I suspect this was changed, butwp_get_http
wasn't kept up-to-date)