#I can t yet figure out how to deal with

1 messages · Page 1 of 1 (latest)

finite dagger
#

can you give an example of how they would be different? if they are considerably different, why not have separate pages?

livid notch
#

For example if on the desktop we have a layout with a category panel (data get from sever) - and a product list as main content, while on mobile only the product list is needed (categories are in a different page). For mobile we don't wanna fetch all the categories because we don't render it

finite dagger
#

are you fetching using multiple fetch() queries (one for categories and one for product list)? or are you using one query to fetch all that? If it's just one query, then the best thing to do would just simple be hiding categories behind a menu or not showing at all on mobile.

livid notch
#

Two different queries, for mobile the idea is not to call the get categories api (on server side)

finite dagger
#

oh are these queries happening in a server side props function?

livid notch
#

Yes, for example using the new experimental "use"

finite dagger
#

ok I'm not familiar with the use feature yet but I think it might not be worth optimizing for this unless it becomes a real problem for the mobile users or if you're struggling to load both on mobile (due to speed/bandwidth issues)

livid notch
#

The same happens with getServerSideProps, if this call for categories is heavy then mobile users are unnecessarily affected. But maybe the solution is more about improving this api performance