Issue
- DXP administrators and users may notice a
zx=
parameter appended to the URL while navigating through the pages of the portal. For example: http://localhost:8080/web/guest/page2?zx=5ml8zs91pgxm
Environment
- Liferay DXP 7.0+
Resolution
- The current behavior is expected on IE11: the
zx
parameter is added by the Automatic Single Page Applications (going forward: SPA) to make the URL unique and prevent caching.
- While disabling the SPA globally in the portal through
javascript.single.page.application.enabled=false
in portal-ext.properties would be a possible workaround, we don't recommend this strategy as it may affect the general page loading performance.
- A better approach would be disabling the SPA on IE11 only: this can be done as follows:
-
- Liferay DXP 7.3, DXP 7.2 and DXP 7.1: Control Panel > Configuration > System Settings > Platform > Infrastructure > Frontend SPA Infrastructure
- Liferay 7.0 DXP: Control Panel > Configuration > System Settings > Foundation > Frontend SPA Infrastructure
-
The change won't affect other browsers and will also mitigate a known performance issue with IE11 and SPA: Internet Explorer 11 Memory Leaks.
- Alternatively, you may use the new MS Chromium Edge (e.g. Edge version 87.0.664.75), where this behavior is not present.
Additional Information
-
Internet-Explorer-Support-Policy
- On IE11, when the
httpMethod
isGET
, the senna.js /metal-uri
adds thezx
parameter to the end of the URL to make the URI unique to avoid caching. At https://github.com/liferay/senna.js/blob/master/src/screen/RequestScreen.js#L120-L122:
formatLoadPath(path) {
Below, the
var uri = new Uri(path);
uri.setHostname(globals.window.location.hostname);
uri.setProtocol(globals.window.location.protocol);
if (globals.window.location.port) {
uri.setPort(globals.window.location.port);
}
if (utils.isIeOrEdge() && this.httpMethod === RequestScreen.GET) {
return uri.makeUnique().toString();
}
return uri.toString();
}makeUnique
function within themetal-uri
package at https://github.com/metal/metal-plugins/blob/master/packages/metal-uri/src/Uri.js#L274-L277:
makeUnique() {
At https://github.com/metal/metal-plugins/blob/master/packages/metal-uri/src/Uri.js#L498, the
this.setParameterValue(Uri.RANDOM_PARAM, string.getRandomString());
return this;
}Uri.RANDOM_PARAM
value will then bezx
:
Uri.RANDOM_PARAM = 'zx';