Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some caching strategies explanation in readme #113

Closed
wants to merge 1 commit into from

Conversation

magnetik
Copy link

@magnetik magnetik commented Oct 3, 2018

It's fairly basic but helps understanding the differences (at least).

Relates to #42.

@@ -45,6 +45,43 @@ $stack->push(new CacheMiddleware(), 'cache');
$client = new Client(['handler' => $stack]);
```

# Caching strategies

## Public and private
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a note about the respect of the RFC-7234 https://tools.ietf.org/html/rfc7234

Theses two strategies automatically respects `Cache-Control` headers containing:
* `no-cache`, `no-store`: response won't be cached
* `max-age`: response will be cached for the corresponding time
It will also honor the `Expires` header will the corresponding TTL.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo will => with?


## Public and private
Theses two strategies automatically respects `Cache-Control` headers containing:
* `no-cache`, `no-store`: response won't be cached
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more complicated than that 😄
From the RFC:

5.2.1.4. no-cache
The "no-cache" request directive indicates that a cache MUST NOT use
a stored response to satisfy the request without successful
validation on the origin server.

Maybe this paragraph should explain that we try to respect the RFC.

@Kevinrob
Copy link
Owner

I close this PR because there is not any change since 6 months.

@Kevinrob Kevinrob closed this Apr 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants