Content Delivery Network (CDN) configuration "cdn.dynamic.resources.enabled=false" is not working
Michael Warren Young
更新于
Issue
After setting cdn.dynamic.resources.enabled=false, Liferay is still accessing some CSS and JavaScript from the CDN URLs configured in cdn.host.http= and cdn.host.https=
Environment
Liferay Portal
Liferay DXP
Resolution
If the properties cdn.host.http= and/or cdn.host.https= are set, then they will be used for static content (for HTTP and HTTPS respectively). The property cdn.dynamic.resources.enabled= does notdisable these properties for static content, it only controls whether they will be user for dynamic contentin addition tostatic content.
If you disable the first two properties as well, either by entering blank values for them or commenting them out in your portal-ext.properties, then Liferay will no longer load JavaScript or CSS from the CDN.
Note that in Liferay DXP 7.0+, these settings can also be configured in Control Panel > Configuration > Instance Settings > Configuration. If they are updated in the control panel, this setting will override any settings in your portal-ext.properties.