Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

# Version 2

## 2.1.0 - TBD

### Added

- Added `EtagCachePlugin` to cache only ETag-backed responses and always revalidate them before serving cached bodies.

## 2.0.2 - 2025-12-01

- Support Symfony 8.
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ composer require php-http/cache-plugin

Please see the [official documentation](http://docs.php-http.org/en/latest/plugins/cache.html).

To only cache ETag-backed responses and always revalidate cached bodies with `If-None-Match`, use `EtagCachePlugin`:

``` php
$plugin = EtagCachePlugin::clientCache($pool, $streamFactory);
```

Responses without an `ETag` header are not cached. Cached responses are only returned after the origin replies with `304 Not Modified`.


## Testing

Expand Down
Loading
Loading