Pagination with concurrent inserts, stale queries and caching