An interesting commit is now available in PHP 7.0.2+; it provides access to zlib's manual dictionary functionality.
What's interesting about being able to inject a dictionary is removing the dictionary overhead of compression from individual items by using a shared one. This is ideal when you're storing data that both (1) isn't large enough to be reliably smaller when storing an ad hoc dictionary alongside the compressed data but (2) has enough duplication that compression sans dictionary will yield significant footprint savings.
Cache and serialized items stored in a database (or similar) are ideal for this: - It's easier to scale PHP process pools than the primary DB server. - Cache item size is a common bottleneck with the DB. - Serialized items in a table tend to have patterns that would benefit from a shared dictionary. - It actually may be cheaper even from PHP's perspective to inflate/deflate than handle more data over the wire. - Some items, like forms and views, can be over a megabyte in their uncompressed forms.
The only real challenge is picking the dictionary and, if it changes, providing versioning. However, even generating and shipping a static (but decent) dictionary per cache bin (or for serialized form data) would massively reduce storage, memory, and network overhead.
Should there be updates to a dictionary, it's possible to detect a mismatch and try an older dictionary. zlib will let you know there's an adler32 mismatch between the dictionary needed and the dictionary supplied.
Recent comments
Funnily we launched a new Dutch website this very week, milieucafe.nl It is not a 'news' website but operates in the context of local government. The layout focuses on content instead of...
Looking for examples of (local) news websites running on BackdropCMS
The answer is off topic, but I'll add a little. 1. Backend. Why you don't need links to other websites: Since you know the structure of your site and content, you can decide for...
Looking for examples of (local) news websites running on BackdropCMS
Hi Chrys, AI isn't always your best friend. A form alter hook is correct, but hiding by CSS isn't ideal. You could look at how the TinyMCE integration does it, which provides hiding...
CKEditor5: Here's how to prevent "Select Image from Library" from appearing