静的ファイルのキャッシュの設定
メディアと静的ファイルのキャッシュ TTL (有効期間)は、expires キーを使用して.magento.app.yaml設定ファイルで設定されます。
NOTE
実稼動環境を更新する前に、ステージング環境の変更をテストすることが重要です。 これらの環境の設定を更新するヘルプについては、Adobe Commerce サポートチケット を送信してください。
-
.magento.app.yamlファイルのwebプロパティ でTTL時間(秒単位)を指定します。expiresキーはlocationsの下、または"/media"と"/static"の下に追加できます。キャッシュの有効期限が切れるのを防ぐには、
expires: -1キーと値のペアを使用します。 次の例を参照してください。code language-yaml # The configuration of app when it is exposed to the web. web: locations: "/media": ... expires: -1 "/static": ... expires: -1 -
コード変更を追加、コミット、プッシュします。
code language-bash git add -A && git commit -m "Set cache TTL for static files" && git push origin <branch-name>
recommendation-more-help
commerce-on-cloud-help-cloud-guide