For example, a mall has 10 merchants, and each merchant has many products. The demand is: every time the user refreshes the page, he will see different products from different merchants. It is not as simple as a random number of product IDs, because it may be repeated. How to implement it specifically
If it is an in-memory database (which may be used by large shopping websites), you can use caching.
If not, it is recommended to implement it on the front-end page. The background is responsible for retrieving data.