Opened 11 years ago
Closed 11 years ago
#33241 closed enhancement (duplicate)
wp_get_http should stream directly to the file
| Reported by: | rmccue | Owned by: | rmccue |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | HTTP API | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Also:
set_time_limit(#21521)redirectionsetting still applies. (I suspect this was changed, butwp_get_httpwasn't kept up-to-date)