legacy-knowledge-base
公開されました Jul. 2, 2025

サーバーのキャッシュをクリアしないと、テーマのJSやCSSの変更が表示されないのはなぜですか?

written-by

Liferay Support

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

課題

  • テーマの開発・デプロイを行っている間、開発環境でも本番環境でも、JSやCSSファイルなどのテーマリソースに加えられた変更を確認するために、サーバーやブラウザのキャッシュをクリアする必要があります。

環境

  • Liferay DXP 7.0+

解決

  • 開発 環境では、 portal-ext.properties ファイルに次のプロパティを追加します: include-and-override=portal-developer.properties。これが終わったら、サーバーを再起動してください。
    すべての情報は Using Developer Mode with Themesに記載されています。 なお、この方法はポータルのパフォーマンスに影響を与える可能性があるため、本番環境ではお勧めできません。

  • 本番 環境では、サポートされている方法は次のとおりです。
      1. サーバーのシャットダウン
      2. 以下のフォルダを削除します。 Liferay/osgi/stateLiferay/workTomcat/workTomcat/temp
      3. 更新されたバージョンのテーマを deploy フォルダに配置
      4. サーバーを再起動

これは、本番環境用に設定されたサーバーが、パフォーマンスを最適化するために非常に積極的にキャッシュを行うために必要なことです。 詳しく説明すると、 portal-developer.properties を使用しないと、テーマで変更されたJS/CSSリソースをサーバーを再起動せずにデプロイすることができなくなります。 言い換えれば、開発が最適に機能するためには、基礎となる開発構成が必要です。

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base