fileserver: speed up directory browsing for large directories (#7903)