S
S
SpeakeazyYT103542019-05-04 19:08:53
PHP
SpeakeazyYT10354, 2019-05-04 19:08:53

How to optimize and shorten PHP code?

Good evening. There is the following code:
https://pastebin.com/RMKtcpH1
The first part of the code up to line 47 is to assemble the $result array with the catalog product SKUs.
The second part of the code, after 47 lines, iterates over the $result array and displays detailed information about each product by article.
There are about 20,000 items.
There was a problem right away. When you try to execute this code, the script starts to load for a long time and eventually the error 504 Gateway Timeout
gets out The page where this error comes out - 93.90.220.244/get/treolan_productslist.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FanatPHP, 2019-05-04
@SpeakeazyYT10354

What is written in the answer above, plus
Find out if the service has the ability to request many records at once.
Cache information whenever possible.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question