Re: How to avoid rate limit when using Server Side Rendering (SSR)?

Solved

How to avoid rate limit when using Server Side Rendering (SSR)?

andres12
Tourist
5 1 3

In the documentation it says that the Storefront API cannot be utilized server-side because of its rate limits. What can I do if I want to use Server Side Rendering (SSR)? And how does Hydrogen avoids this problem if it also uses SSR?

Accepted Solution (1)

andres12
Tourist
5 1 3

This is an accepted solution.

I think I've found the answer here: https://shopify.dev/api/storefront#rate_limits

 

If you use a server-side library, the IP address of the request will be your server’s address. To ensure your app is throttled correctly, use a delegate access token and pass it in the Shopify-Storefront-Private-Token header from server contexts. Requests using this authentication method can pass the buyer IP into the Shopify-Storefront-Buyer-IP header.




View solution in original post

Replies 7 (7)

Sello_2k
Shopify Partner
9 0 1

Would love to get any answer on this question

andres12
Tourist
5 1 3

This is an accepted solution.

I think I've found the answer here: https://shopify.dev/api/storefront#rate_limits

 

If you use a server-side library, the IP address of the request will be your server’s address. To ensure your app is throttled correctly, use a delegate access token and pass it in the Shopify-Storefront-Private-Token header from server contexts. Requests using this authentication method can pass the buyer IP into the Shopify-Storefront-Buyer-IP header.




Sello_2k
Shopify Partner
9 0 1

Hey @andres12,

can you explain me the solution?

I would be really thankfully.

andres12
Tourist
5 1 3

I've just updated my answer because I had an error in the quote I put. The solution is in the link I mentioned in the "Usage limitations" section. I don't know how to explain it better and I haven't implemented it yet.

Sello_2k
Shopify Partner
9 0 1

@andres12 

oh okey, i tried these too but it doesnt work for me.

Can you teach me after if it is working for you?

Would be really nice.

hyperlab
Shopify Partner
4 0 0

Has anyone gotten this to work? Seems like a lot of people (including us) are struggling with this...

_JCC_
Shopify Staff
200 27 55

Hey everyone 👋. We're now live 😀 🎊. Change log entry has been posted here with links to documentation.

John C | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog