Skip to content

[question] how to define time how long should the cache live? #117

Open
@str

Description

@str

Hi!

It looks like my cache lasts for a very short time. This is how I define my cache middleware:

        $stack = HandlerStack::create();
        $stack->push(
            new CacheMiddleware(
                new PrivateCacheStrategy(
                    new FlysystemStorage(
                        new Local('./tmp/cache/guzzle/')
                    )
                )
            ),
            'cache'
        );
        $client = new Client([
            'handler'         => $stack,
            'allow_redirects' => false,
            'referer'         => true,
            'track_redirects' => true,
        ]);

how can I define how long my cache should last? Like in days?

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