optimizing pagination for large product catalogs