Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikespub committed Dec 17, 2023
2 parents 59d1d35 + 62bc4f7 commit 4fe9640
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [2.2.0] - 2023-12-14
## [3.0.0] - 2023-12-17
### Added
- New test cases for Cache using ETag

### Changed
- Replaced read-only `micheh/psr7-cache` with updated `mikespub/micheh-psr7-cache`
- Updated version constraints for dependencies

### Removed
- Support for PHP prior to 8.1.

## [2.1.0] - 2020-12-02
### Added
- New middleware `ClearSiteData`.
Expand Down Expand Up @@ -70,9 +72,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Changed
- Updated to `http-interop/http-middleware#0.3`

## 0.1.0 - 2016-10-03
## [0.1.0] - 2016-10-03
First version

[3.0.0]: https://github.com/middlewares/cache/compare/v2.1.0...v3.0.0
[2.1.0]: https://github.com/middlewares/cache/compare/v2.0.0...v2.1.0
[2.0.0]: https://github.com/middlewares/cache/compare/v1.1.0...v2.0.0
[1.1.0]: https://github.com/middlewares/cache/compare/v1.0.0...v1.1.0
Expand All @@ -82,3 +85,4 @@ First version
[0.3.1]: https://github.com/middlewares/cache/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/middlewares/cache/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/middlewares/cache/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/middlewares/cache/releases/tag/v0.1.0
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ Middleware components with the following cache utilities:
* [CachePrevention](#cacheprevention)
* [Expires](#expires)
* [Cache](#cache)
* [ClearSiteData](#clearsitedata)

## Requirements

* PHP >= 7.2
* PHP >= 8.2
* A [PSR-7 http library](https://github.com/middlewares/awesome-psr15-middlewares#psr-7-implementations)
* A [PSR-15 middleware dispatcher](https://github.com/middlewares/awesome-psr15-middlewares#dispatcher)

Expand Down Expand Up @@ -69,7 +70,7 @@ $expires = (new Middlewares\Expires($durations))->defaultExpires($default);

## Cache

Saves the response headers in a [PSR-6 cache pool](http://www.php-fig.org/psr/psr-6/) and returns `304` responses (Not modified) if the response is still valid. This saves server resources and bandwidth because the body is returned empty. It's recomended to combine it with `Expires` to set the lifetime of the responses.
Saves the response headers in a [PSR-6 cache pool](http://www.php-fig.org/psr/psr-6/) and returns `304` responses (Not modified) if the response is still valid (based on its `ETag` or `Last-Modified` header). This saves server resources and bandwidth because the body is returned empty. It's recomended to combine it with `Expires` to set the lifetime of the responses.

```php
$cachePool = new Psr6CachePool();
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "mikespub/middlewares-cache",
"name": "middlewares/cache",
"type": "library",
"description": "Middleware with various cache utilities",
"license": "MIT",
Expand All @@ -15,7 +15,7 @@
},
"require": {
"php": ">=8.1",
"middlewares/utils": "^3.3",
"middlewares/utils": "^4.0",
"mikespub/micheh-psr7-cache": "^2.0",
"psr/cache": "^1.0 || ^2.0 || ^3.0",
"psr/http-server-middleware": "^1.0"
Expand Down

0 comments on commit 4fe9640

Please sign in to comment.