Skip to content

[Cache] Redis Adapter wrongly purpose a compression option #15050

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

Closed
bastnic opened this issue Mar 2, 2021 · 6 comments · Fixed by #15052
Closed

[Cache] Redis Adapter wrongly purpose a compression option #15050

bastnic opened this issue Mar 2, 2021 · 6 comments · Fixed by #15052
Labels

Comments

@bastnic
Copy link
Contributor

bastnic commented Mar 2, 2021

Since symfony/symfony#34133, the compression is gone but it's still documented here https://symfony.com/doc/current/components/cache/adapters/redis_adapter.html#available-options and marked as enabled by default.

I'm still trying to figure if my app lost the compression by upgrading to 4.4 / 5.x.

@Nyholm
Copy link
Member

Nyholm commented Mar 2, 2021

Thank you for this issue.

The compression option was never released in 4.4. It did not work and was removed.

I'm still trying to figure if my app lost the compression by upgrading to 4.4 / 5.x.

No, but it may have lost compression upgrading from 4.3 to 4.4.

Also note that this is a "Redis cache" and not a "Redis store". A cache can always be calculated and will never store something valuable.

@bastnic
Copy link
Contributor Author

bastnic commented Mar 2, 2021

Hi @Nyholm,

I upgraded my app 4.1 => 4.2 => 4.3 => 4.4 => 5.0 => 5.1. So in a certain time I had the compression working then not. I've issue with high redis bandwidth right now. I assumed I had a compression knowing the parameter and having redis correctly installed. But I saw that the cached value was plain php serialized data, no binary. I unrolled everything and voila.

@Nyholm
Copy link
Member

Nyholm commented Mar 2, 2021

Interesting. Will the DeflateMarshaller help you?

services:
    Symfony\Component\Cache\Marshaller\DeflateMarshaller:
        decorates: cache.default_marshaller
        arguments: ['@Symfony\Component\Cache\Marshaller\DeflateMarshaller.inner']

@bastnic
Copy link
Contributor Author

bastnic commented Mar 2, 2021

That's exactly what I discovered and that I will try soon.

@Nyholm
Copy link
Member

Nyholm commented Mar 2, 2021

Btw, The DefaultMarshaller supports the igbinary extension. That might also be interesting for you.

@nicolas-grekas
Copy link
Member

DeflateMarshaller is what replaces redis compression option yes.

javiereguiluz added a commit that referenced this issue Mar 5, 2021
This PR was submitted for the 5.x branch but it was squashed and merged into the 5.2 branch instead.

Discussion
----------

[Cache] Adding about marshallers

This is related to #15050

It will add information about serialisation, encryption and compression.

Commits
-------

126cf24 [Cache] Adding about marshallers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants