Skip to content

Commit 260452d

Browse files
Mark http responses with status codes 300, 301, 302 and 410 cacheable
See Symfony's isCacheable() method: https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/HttpFoundation/Response.php#L569-L580
1 parent 091a793 commit 260452d

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9+
## [1.2.1] - 2023-10-30
10+
### Fixed
11+
- Mark http responses with status codes `300`, `301`, `302` and `410` cacheable
12+
913
## [1.2.0] - 2023-09-13
1014
### Added
1115
- Add Drupal 10 support. Drop Drupal 9 support.

src/Service/Cache/Validation/Validation.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ class Validation implements EventSubscriberInterface
1717
protected $cacheableStatusCodes = [
1818
Response::HTTP_OK => true,
1919
Response::HTTP_NON_AUTHORITATIVE_INFORMATION => true,
20+
Response::HTTP_MULTIPLE_CHOICES => true,
21+
Response::HTTP_MOVED_PERMANENTLY => true,
22+
Response::HTTP_FOUND => true,
2023
Response::HTTP_NOT_FOUND => true,
24+
Response::HTTP_GONE => true,
2125
];
2226

2327
protected $cacheableMethods = [

0 commit comments

Comments
 (0)