'Having some data in Redis how to implement dynamic listing of data?

Working with "predis/predis": 1.1 in laravel 9 app I managed to read data with Redis::get and no data found to read it from database and write it into redis with Redis::set( method.

When related data are saved under admin area I make update of these data in redis with Redis::del and Redis::set( methods. It works ok when I need to read some data by unique key or unique slug. But what I need to do a listing of data. Say I have 60 items and I show 10 items on 1 page so pagination has 6 links. Also page has 3 parameters for sorting order(name, published date and price). I would like to read these data from database and write into redist and use them for listing too, but it seems too tricky for me. From my examples looks like I need to have 3 versions of 6 paginated pages with 10 items in any...

Which are possible decisions for these issue ?

Thanks advance!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source