1👍
It depends on your filesystem, which solution is better.
If you have a lot of products, the inode count could be matter
on your file system. Then solution #1 has less overhead.
If the performance of directories with lots of files with long filenames is worse, solution #2
is better.
Source:stackexchange.com