ZIP Streaming Decompression: Technical Principles and Implementation
The article explains Alibaba Youku’s picture‑book team’s streaming ZIP decompression technique that bypasses the end‑of‑file central directory by using each entry’s local file header, supports PKWARE and AES‑encrypted archives, and achieves up to 100 % faster extraction, reducing a 30 MB file’s load time to under one second.
This article introduces ZIP streaming decompression technology developed by Alibaba Youku's picture book technology team. Traditional ZIP decompression requires downloading the entire file first, as standard decompression starts from the end of the file. This creates significant user experience issues when accessing ZIP files over networks.
The solution enables "download-while-decompress" functionality by eliminating dependency on the Central Directory at the file's end. Instead, the approach uses Local File Header information located at the beginning of each file entry, which contains all necessary metadata: compression method, compressed/uncompressed sizes, CRC-32 checksums, and file names.
For encrypted ZIP files, the solution addresses challenges where Local File Header hides critical information. Both Traditional PKWARE Encryption and AES Encryption (CTR mode) support streaming decryption. AES encryption details (strength, actual compression method) are stored in the Extra Field of Local File Header, while salt values are positioned at the beginning and end of File Data.
Implementation results show remarkable performance improvements: for a 39.1 MB ZIP file, decompression time reduced from 9.08 seconds to 4.17 seconds (approximately 100% speed improvement). For Youku's picture book project, 30MB+ files now load in just 0.91 seconds on average—an 88.3% reduction in loading time.
Youku Technology
Discover top-tier entertainment technology here.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.