I am considering using the wp_remote_get() function in a WordPress project I am building to import an external XML feed to update WooCommerce products. What I am concerned with is this XML feed could be very large and storing this data in a PHP variable might end up being a memory problem. Is wp_remote_get() the correct function to use and what might I do to ensure that I don't run into memory issues?
Asked
Active
Viewed 27 times
0
-
What is "very" large? The size of the data itself might be less of a problem, than how much memory parsing the XML takes. In that case, you should look into _stream parsers_, https://stackoverflow.com/questions/18518602/stream-parse-4-gb-xml-file-in-php – CBroe Mar 14 '22 at 11:38