fixing pagination and honouring the CACHE setting