Problem/Motivation

Like for other cache backends in core and contrib, the serializer should be configurable instead of hardcoding the usage of the php serializer.
That would allow to use igbinary and/or a compressing serializer which make a lot of sense for files.

Steps to reproduce

Proposed resolution

Follow the examples in core and contrib and use dependency injection for the serializer service

Remaining tasks

User interface changes

none

API changes

Additional constructor argument which isn't a BC break in Drupal.

Data model changes

none

Comments

mkalkbrenner created an issue. See original summary.

mkalkbrenner’s picture

Status: Active » Needs review
StatusFileSize
new5.15 KB
socialnicheguru’s picture

from #3357130: PHP 8.1 serializer vs igbinary serializer speed and memory usage

We run PHP 8.1. We switched a file based cache from serialize to igbinary and the file size was reduced by aprox. 90%. So this was a massive improvement.

socialnicheguru’s picture

Status: Needs review » Reviewed & tested by the community

This works well.
I am able to replace serializer.

pfrenssen’s picture

StatusFileSize
new6.11 KB
new3.46 KB

This is a really good idea. I tried out the serialization.igbinary_gz service from the igbinary module and it reduced my cache folder to 25.18% of the original size.

However this took some figuring our since the igbinary module is still experimental and doesn't have much documentation. It's README consists mostly of TODOs.

Patch adds instructions on how to set it up, and does some small documentation updates.

pfrenssen’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

mkalkbrenner’s picture

:-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.