Fix caching problem that ignores offset/limit