Skip to content

[Cache] Adding about marshallers #15054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2021
Merged

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Mar 2, 2021

This is related to #15050

It will add information about serialisation, encryption and compression.

@bastnic
Copy link
Contributor

bastnic commented Mar 2, 2021

How to use them?
When to use what? Igbinary better than compression?

@Nyholm
Copy link
Member Author

Nyholm commented Mar 2, 2021

I think it depends on your data. Some types of data might be better with Igbinary. I have not tested any of them so I cannot really tell.

How to use them?

I'll add a code example.

use Symfony\Component\Cache\DeflateMarshaller;

$marshaller = new DeflateMarshaller(new DefaultMarshaller());
$cache = new RedisAdapter(new \Redis(), 'namespace', 0, $marshaller);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add the way to do it framework side?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in this docs. This is for the component only.

@javiereguiluz javiereguiluz changed the base branch from 5.x to 5.2 March 5, 2021 12:07
@javiereguiluz javiereguiluz merged commit 085b525 into symfony:5.2 Mar 5, 2021
@javiereguiluz
Copy link
Member

Tobias, thanks a lot for contributing this. All this "marshallers thing" was confusing to me, so this was lacking in the docs.

While merging I did some changes to add an introductory note explaining, very briefly, the differences between serializing and marshalling. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants