Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dmag's avatar

Lazy Collection with external API

Is there any benefit to using Lazy Collection on 8mb dataset that is retuned at once from an external api and that I need to iterate over?

0 likes
2 replies
tykus's avatar

Since you are getting the entire 8MB in the Response, your only option is to write that data to a file on your side, and then read the file lazily to perform whatever operations you need on that data.

kevinbui's avatar

Who the hell send 8mb of data in a single API response?

Could you share that API?

Do they have any sort of data pagination? If not can we request them to do so?

Please or to participate in this conversation.