Timeout with . Slince\Shopify

Highlighted
New Member
1 0 0

Hi Friends, I am using the php api by Slince\Shopify.

 

I did a APP. This APP update all products 1 by 1. If i work with 100 products for example, it works perfect, but . if i work with a lot of products i get "Gateway Timeout".

 

My PHP script has set time limit 0, ignore user abort etc. 

 

the problem is on the shopify way, i don't know what else can i do :(

 

0 Likes
Shopify Staff (Retired)
Shopify Staff (Retired)
624 102 127

Hey @zerd ,

 

Request for a large amount of products in a single API request will result in a timeout on Shopify's end. Requesting a lot of products, or any data entities from our API, will create a large query for our database that will take a long time to complete and large processing load on our servers to handle so after a certain amount of time Shopify will timeout the request.  In order to work around this, you should paginate your request with cursors to break your request into multiple smaller parts. This will let you get all of your requested data with much less chances of timing out. This blog would be a helpful resource to read on this topic: https://engineering.shopify.com/blogs/engineering/pagination-relative-cursors

 

Alternatively, you can also look into using the Shopify Bulk Operations API to query a large amount of data in one request without having to worry about pagination: https://help.shopify.com/en/api/guides/bulk-operations

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
New Member
1 0 0

@hassain wrote:

Hey @zerd ,

 

Request for a large amount of products in a single API request will result in a timeout on Shopify's end. Requesting a lot of products, or any data entities from our API, will create a large query for our database that will take a long time to complete and large processing load on our servers to handle so after a certain amount of time Shopify will timeout the request.  In order to work around this, you should paginate your request with cursors to break your request into multiple smaller parts. This will let you get all of your requested data with much less chances of timing out. This blog would be a helpful resource to read on this topic: https://engineering.shopify.com/blogs/engineering/pagination-relative-cursors

 

Alternatively, you can also look into using the Shopify Bulk Operations API to query a large amount of data in one request without having to worry about pagination: https://help.shopify.com/en/api/guides/bulk-operations

 


I want to add 10000 products in shopify using rest api, but when I have the problem, when I add the 101th product, the request is always timeout.
What should I do?
0 Likes