Skip to content

PSR-7 responses shouldn't be considered as serializable #81

Closed
@nicolas-grekas

Description

@nicolas-grekas

In src/CachePlugin.php, PSR-7 responses are serialized as is, except the response body, which is serialized separately.

Recently the PHP engine started to throw deprecations when a resource is found in a serialized data structure.
And this happens to PSR-7 responses: whatever the implementation, their body is a represented as a stream resource internally.
Also, from an abstraction PoV, nothing says in PSR-7 that responses are serializable, which means interop should consider them as non-serializable.

The plugin should be improved to not store PSR-7 objects directly, but intermediate representations that fit a generic cache backend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions