Skip to content

[cache] Make cache item expiry accessible #34487

Closed
@drzraf

Description

@drzraf

Description
I would like read-only access to CacheItem->expiry, eg via a getExpiry() method.

Example
I use cache as a kind of locally-stored-expiring-lock in order to avoid reissuing a (temporary) failed HTTP request during a given time.
When checking for the cacheItem I would like to access the expiry.
My use-case is that I can issue a request short before cache actually expire and progressively increase its expiration time (like 1 hour, 3 hours, 6 hours, ...).

Reference:
https://stackoverflow.com/questions/58527540/how-to-get-expiration-datetime-of-items-using-symfonys-cache-component

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions