Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

HTTP cache invalidation: sub-resource collections need an extension point

オープン
#7,965 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
68/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
laravel, php, symfony

調査の方向性

まず既存の PurgeHttpCacheListener の実装と Serializer\TagCollectorInterface を読み、次に src/HttpCache/ 領域と Symfony および Laravel の wiring を調査します。新しい provider interface が利用可能になり、optional provider が集約されて両方の listener から参照され、yield されたタグが追加され、この拡張ポイントがドキュメント化されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

performance

Problem

PurgeHttpCacheListener (Symfony Doctrine and Laravel Eloquent) cannot invalidate sub-resource collection operations such as /parents/{parentId}/children. Resolving the IRI requires parent uriVariables that the listener does not have when it sees the modified entity, so those collection tags are silently skipped.

Pragmatic solution

Expose a public extension point — symmetric to Serializer\TagCollectorInterface on the response side — that the listener consults to collect extra tags for a given entity:

namespace ApiPlatform\HttpCache;

interface PurgeTagProviderInterface
{
    /**
     * @return iterable<string> additional cache tags to invalidate for $entity
     */
    public function getTagsForResource(object $entity): iterable;
}

Wiring:

  • Tagged service (Symfony) / iterator binding (Laravel), aggregated and injected into PurgeHttpCacheListener.
  • The listener appends whatever the providers yield to its existing tag set.
  • Default ships with no provider — users opt in.

This keeps identifier-finding out of the framework (the user knows how their child invalidates their parents) and lets each project plug exactly the strategy that fits its routing (parent uri_variables, surrogate-key prefixes, class-based tags, etc.).

Scope

  • Add the interface in src/HttpCache/.
  • Inject iterable<PurgeTagProviderInterface> (optional, default empty) into both Symfony and Laravel PurgeHttpCacheListener.
  • Document the seam alongside TagCollectorInterface.
主要言語
PHP
スター
2.6k
フォーク
982
平均マージ
1日 16時間
マージ済み PR(30日)
59

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

api-platform/core のほかの issue

api-platform/core の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。