Skip to content

Dalli Compatibility #7

@cjbottaro

Description

@cjbottaro

Hello again!

Memcachex is not compatible with Dalli, even if both of them are using JSON as the serializer. The reason is that Dalli will only run the deserialize if a certain bit is set on the flags of the key. Here's the relevant code:

Only deseralize if bit is set:
https://github.com/petergoldstein/dalli/blob/master/lib/dalli/server.rb#L442

Set serialization bit if a serializer is used:
https://github.com/petergoldstein/dalli/blob/master/lib/dalli/server.rb#L435

I'm not entirely sure, but I think the fix would be to set that bit in the flags on the set, add, and replace commands (if a coder is specified).

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions