Skip to content

1.19.0

Choose a tag to compare

@koriym koriym released this 06 Nov 05:52
· 287 commits to 1.x since this release

A purge-reach release. Purging a URI without its optional query now also reaches its query variants and the pages that embed them, and a #[Cacheable] parent now depends on a child that carries only a Surrogate-Key.

Before you deploy / デプロイ前に

  1. Bump the CacheVersionModule version, or clear the pools if you bind your own cache adapter. Entries stored by earlier versions carry no group tag, so a purge of the bare URI would not reach their query variants.
    CacheVersionModuleのバージョンを上げてください。 独自のキャッシュアダプターを束縛している場合は、プールをクリアしてください。以前のバージョンが保存したエントリはグループタグを持たないため、クエリなしのURIを無効化しても、クエリだけが異なるキャッシュに届きません。
  2. Rebuild the injector. QueryRepository, DonutRepository, ResourceStorage and CacheInterceptor take new constructor dependencies, so scripts compiled with 1.18.0 and injectors serialized by BEAR.Package 1.23 or earlier no longer fit.
    injectorを作り直してください。 QueryRepository、DonutRepository、ResourceStorage、CacheInterceptorのコンストラクタが変わったため、1.18.0でコンパイルしたスクリプトや、BEAR.Package 1.23以前がシリアライズしたinjectorは使えません。
  3. A custom PurgerInterface must split its argument on spaces. purge() now passes two tags in one call. The Fastly purger (bear/fastly-module) already does.
    独自のPurgerInterfaceは、引数を空白で分割してください。 purge()は1回の呼び出しで2つのタグを渡します。Fastly用のpurger(bear/fastly-module)は分割しています。
  4. Expect wider invalidation. A write now purges every variant that differs only in default-valued parameters (every language of an entity with string $lang = 'ja', for example), and a #[Cacheable] parent is dropped when a child that carries only a Surrogate-Key changes. Watch the cache hit rate after deploying.
    無効化の範囲が広がります。 書き込みは、既定値を持つ引数だけが異なるすべてのキャッシュ(例:string $lang = 'ja'を持つエンティティの全言語)を無効化します。Surrogate-Keyだけを持つ子が変わると、#[Cacheable]の親も無効化されます。デプロイ後はキャッシュヒット率を確認してください。
  5. Catch Exception\CacheStoreException instead of Exception\CacheStoreFailure. The class is renamed with no alias, and its message no longer repeats the cause's; read the cause from getPrevious().
    Exception\CacheStoreFailureを捕捉しているコードは、Exception\CacheStoreExceptionに変えてください。 別名は残していません。メッセージは原因のメッセージを繰り返さなくなったので、原因はgetPrevious()で取り出してください。

Notable changes

  • Purging app://self/articles now also drops app://self/articles?page=2; a page that embeds it is dropped, or recomposed when it renders it as a hole (#255, #257).
  • A purge URI that spells out a default value (?page=1) reaches only that URI. A required key has to be spelled the way the GET spelled it (?user_id=1 vs ?userId=1); the automatic purge after a write spells it as the parameter does (userId), so it does not reach entries a GET stored with ?user_id=1.
  • A shared Surrogate-Key added to every variant only so that one purge reaches them all is no longer needed in the server-side pools, nor at the CDN for donut pages. Variants that differ in a required parameter, and #[Cacheable] resources at the CDN, still need one.
  • New log context dependency_skipped: a cached parent says why it left an embedded child out of its dependencies (#258).
  • A recomposed donut page keeps every hole's tags, so a hole cached by its ETag alone can be purged more than once.
  • A body serialize() refuses (a PDO connection, a closure, an HTTP client, a DOM node) no longer fails every request in production: ProdQueryRepositoryModule binds SkipSerializationError, so the response goes out uncached, without CDN lifetime headers, and is logged as put_skipped{reason: unserializable} with the failing class. The default binding, ThrowSerializationError, still fails the request, now naming the resource URI. Bind your own BodySerializationErrorHandlerInterface to report the failure and return (#259).
  • A conditional request is no longer answered 304 for a response the pool failed to store: an ETag is kept only once its entry is stored, so in the log save_etag now follows the entry's save (#261).

See CHANGELOG.md for the full list, and the "Invalidate by URI" section of the cache manual for what a purge reaches.