You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
コンテンツのカテゴリーを以下のタイプに分けコンテンツのタイプを宣言することで、抽象度を上げたキャッシュコントロールを実現する。
それぞれのクラスに以下のアトリビュートを付与する。
イベントドリブン
#[EventDrivenCache]
または
#[CacheableResponse type: event_driven]
TTLを持たず、リソースリクエストなどのイベントによるキャッシュの無効化が可能なコンテンツ。TTL無制限。
共有キャッシュタイプ
アダプティブTTLキャッシュ
#[AdaptiveTtlCache]
または
#[CacheableResponse type: adaptive_ttl]
キャッシュ無効日時が予定できるコンテンツ。イベントによるキャッシュ無効化も有効。
固定TTLキャッシュ
#[FixedTtlCache]
または
#[CacheableResponse type: fixed_ttl]
イベントや予定による無効化が不可能で、固定制限時間で無効化するコンテンツ。イベントによるキャッシュ無効化も有効。
クライアントサイドキャッシュコントロール
クライアントでのキャッシュを
client
で指定します。#[CacheableResponse type: event_driven client: none]
#[CacheableResponse type: fixed_ttl client: revalidate]
#[client: ttl]
共有キャッシュのTTLを共有します。
#[client:revalidate]
ETagによる条件付きリクエストを行い、サーバーサイドでコンテンツの変更を確認します。変更ががないならクライアントサイドキャッシュを再利用します。
#[client: none]
クライアントサイドではキャッシュしません。
キャッシュ不可能
#[Uncachable]
または
#[UnccacheableResponse]
検討:TTLの指定方法
Beta Was this translation helpful? Give feedback.
All reactions