Fundamentals 9 min read

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.

Youku Technology
Youku Technology
Youku Technology
ZIP Streaming Decompression: Technical Principles and Implementation

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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AES encryptionCentral DirectoryFile CompressionLocal File HeaderPKWARE encryptionStreaming DecompressionZIP format
Youku Technology
Written by

Youku Technology

Discover top-tier entertainment technology here.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.