Skip to content

Commit

Permalink
Merge pull request #28 from wieni/more-cacheable-http-statuscodes
Browse files Browse the repository at this point in the history
Mark http responses with status codes `300`, `301`, `302` and `410` c…
  • Loading branch information
DieterHolvoet authored Oct 30, 2023
2 parents fd699f1 + a674201 commit c1a5861
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0-alpha4] - 2023-10-30
### Fixed
- Mark http responses with status codes `300`, `301`, `302` and `410` cacheable
- Don't cache node preview responses
- Don't cache responses of the [drupal/preview_link](https://www.drupal.org/project/preview_link) module

## [1.0.0-alpha3] - 2023-07-19
### Added
- Support `stale-while-revalidate` and `stale-if-error` cache control header
Expand Down
4 changes: 4 additions & 0 deletions src/Validation/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ class Validation implements EventSubscriberInterface
protected $cacheableStatusCodes = [
Response::HTTP_OK => true,
Response::HTTP_NON_AUTHORITATIVE_INFORMATION => true,
Response::HTTP_MULTIPLE_CHOICES => true,
Response::HTTP_MOVED_PERMANENTLY => true,
Response::HTTP_FOUND => true,
Response::HTTP_NOT_FOUND => true,
Response::HTTP_GONE => true,
];

/** @var array<string, bool> */
Expand Down

0 comments on commit c1a5861

Please sign in to comment.