Overview
Salesforce Spring ’25 introduces the Compression
Apex namespace, which provides built-in support for ZIP file creation and extraction. This native functionality offers efficient compression using DEFLATE, improved performance, and reduced CPU consumption.
What This Rule Checks
This rule identifies usages of third-party Apex ZIP libraries such as Zippex
and flags them as candidates for replacement with the new native Compression
namespace.
These libraries may:
Consume excessive CPU time, especially when working with large files
Lack true compression, as they may omit DEFLATE or other compression algorithms (e.g., Zippex only stores files without compressing them)
Be unnecessary now that native support exists
Why Use the Native Compression API?
Using the built-in Salesforce compression offers reduced CPU usage by being more efficient than third-party Apex code, supports real compression with algorithms like DEFLATE (unlike libraries such as Zippex that don’t compress data), and simplifies code by eliminating the need for external libraries or client-side workarounds.
Additional Context
Many teams previously offloaded ZIP file creation to JavaScript in the browser or used libraries like Zippex due to lack of native support.
With the introduction of the
Compression
namespace, these workarounds are no longer necessary and should be phased out to improve performance and maintainability.