legacy-knowledge-base
公開されました Sep. 10, 2025

他のコンテンツ タイプのキャッシュ コントロール ヘッダー

written-by

Kanchan Bisht

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

問題

  • 次のプロパティで
    browser.cache.disabled=false
    キャッシュ ヘッダーは、 text/csstext/javascriptimg/png などの他のコンテンツ タイプで設定されていません。

Environment

  • Liferay DXP 7.4

解決策

  • browser.cache.disabled プロパティは、MainServlet および他のいくつかのあまり一般的でないサーブレットからチェックされます。 これは、これらのサーブレットの応答が、サービスを提供するリソースのキャッシュ制御ヘッダーを発行することを意味します。 MainServet の場合、これはポータル ページ (基本的には HTML コンテンツ) を意味します。 それにもかかわらず、他のリソースは異なるサーブレットから提供されます。 そして、それらはキャッシュの動作を決定するためにそのプロパティを利用していません。
    したがって、キャッシュ ヘッダーは、 text/csstext/javascriptimg/png などの他のコンテンツ タイプでは設定されていません。
  • これらの他のリソースは、キャッシングを無効にする独自のメカニズムを管理し、さまざまなサーブレットが、提供するものに応じてこれらのヘッダーを制御します。
    たとえば、モジュール解決の提供を担当する JSResolveModulesServlet.javaは、構成不可能な方法で、これらのヘッダーに意図的に特定の値を設定します。
    • : リソースのキャッシュを無効にすると、ページにアクセスするたびにブラウザからサーバーにリソースが要求されるため、パフォーマンスが大幅に低下します。

追加情報

  • プラグマを無効にする: no-cache ヘッダー
  •  #
    # Set this to true if you want the portal to force the browser cache to be
    # disabled. It will only disable the cache for the rendered HTML response.
    # It will not have an impact on static content or other resources.
    #
    # Env: LIFERAY_BROWSER_PERIOD_CACHE_PERIOD_DISABLED
    #
    browser.cache.disabled=true
did-this-article-resolve-your-issue

legacy-knowledge-base