A tool to speed up downloading of large amounts of small files
This project originated from a game I played before. It would download a large number of small files when updating the version. However, there was no optimization, so the speed was very slow. Therefore, I thought about whether there is a way to optimize the download scenario of a large number of small files. After a simple idea, I came up with this idea. , since the download speed is slow because there are too many small files, then just put them all into one large file. After all, the download speed of large files can theoretically reach the full bandwidth!
The principle of the project is to directly link a large number of small files into a block file, and then generate a catalog. The client downloads the block file through the catalog and restores the file locally based on the file size and path. Based on the characteristics of HTTP Range
, it can also achieve interruption. Click to reconnect and download a file function
assets
folder in the same directoryassets
folder, such as assets/example
assets
directory and create catalog.json
for them.Server started at http://0.0.0.0:8080
which means the startup is complete.client
to start downloading the file.
is the download address of catalog.json
, which will be automatically generated when the server starts. Assume that your server file path is assets/example
, then the catalog address is http://localhost:8080/example/catalog.json
download
folder Build requires Golang >= 1.22.2
go mod tidy
go build ./cmd/server/
go build ./cmd/client/
Import package
go get -u github.com/nijinekoyo/miyako
Package instructions
This project is distributed under the MIT License
agreement