Why the whole idea of page number in cache?

Why divide the cache in pages ?

I could think that you may have wondered what would happen if you had thousands of files in a single directory, so, split this in “pages”

but it could have been done in a far easier way embedding the “page” in the filename and the use that information to go to subdirectory

but maybe there is another reason