問題
キャッシュがクリアされない限り、CSSの変更はブラウザに反映されません。
環境
- Liferay DXP 6.2
解決策
ブラウザのキャッシュがクリアされないうちは、CSSの変更がテーマに反映されます。 そのため、 portal-ext.propertiesの "false" として、以下のプロパティを設定し、変更を反映させています。
# Set this property to true to load the theme's merged CSS files for faster
# loading for production.
#
# Set this property to false for easier debugging for development. You can
# also disable fast loading by setting the URL parameter "css_fast_load" to
# "0".
#
theme.css.fast.load=true
# Set this property to true to load the packed version of files listed in
# the properties "javascript.barebone.files" or
# "javascript.everything.files".
#
# Set this property to false for easier debugging for development. You can
# also disable fast loading by setting the URL parameter "js_fast_load" to
# "0".
#
javascript.fast.load=true
theme.css.fast.load と javascript.fast.load のプロパティを無効にする理由(つまり portal-ext.properties で false に設定する) は、Liferay がキャッシュファイルを使うことを制限するため、実行時にデプロイすることができます。そうしないと再起動するまで結果を確認できない場合があります。 ただし、ブラウザのキャッシュが邪魔をする可能性はあります。 これらのプロパティをテストしても、実行時にカスタムwarファイルのファイルに希望の変更を加えることができない場合、変更を反映させるためにwarファイルを再展開する必要がある場合があります。