I have a i.tar.gz
file of a folder with 1,000,000 unique .json
files. I tried to use the $a=file_get_contents('phar://path/to/i.tar.gz/filename.json');
and echo $a;
takes forever to load on browser. Any help is appreciated.
Asked
Active
Viewed 407 times
1 Answers
1
A .tar.gz
file cannot be accessed randomly. All of the files up to the one you want must be decompressed.
You can try using a .zip
file instead, which will permit rapid random access. However the compression of many small files could be much worse, since zip entries are compressed independently and not able to use repeated information in the previous files to aid in the compression of subsequent files.

Mark Adler
- 101,978
- 13
- 118
- 158