Skip to content

Not respect cache headers #19

Closed
@egeloen

Description

@egeloen

Hey!

It seems since the last changes, I'm not able to don't consider headers at all.

Here, my set up:

$this->client = new PluginClient(new Client(), [
    new ErrorPlugin(),
    new CachePlugin(
        new FilesystemAdapter('', 0, __DIR__.'/cache'),
        new GuzzleStreamFactory(),
        ['respect_cache_headers' => false]
    ),
]);

After debuggint it, I would update https://github.com/php-http/cache-plugin/blob/master/src/CachePlugin.php#L78 by:

if (!$this->config['respect_cache_headers'] || (isset($data['expiresAt']) && time() < $data['expiresAt'])) {

WDYT?

Metadata

Metadata

Assignees

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