[optimize] Use <base> tag for predicatable relative paths #14045
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Kibana 4.3 we added the
server.basePath
setting to enable better support for running Kibana somewhere other than the root of a web server (eg./logs/kibana/app/kibana
instead of/app/kibana
). Unfortunately using this configuration triggers a re-optimization because the basePath was previously being written into the bundles in order to ensure compatibility in all scenarios. The optimization process has gotten longer and more painful over the years, and we are working to remove it entirely, so we needed a way to support basePath without needing to write it into the bundles.Starting in 6.1 Kibana will use the
<base>
tag to adjust the way that relative URLs are resolved, ensuring that URLs at any page are resolved relative to the basePath. In order to support this, allhref
,src
, and API call that is currently using relative urls (including hash urls) needs to be updated to include all path segments following the basePath.This is a pretty major breaking change for anyone creating or storing relative URLs, so
to the HTML and JavaScript where relative URLs should be resolved from. Doing this prevents us from needing to rebuild assets, and allows us to support basePath in the future when we are no longer optimizing in production, but is a
If you are storing relative URLs in markdown panels, URL field formatters, or source code then you will need to migrate to a new relative "format".
HTML and JS
Relative URLs previously resolved based on the current page but now resolve relative to the basePath. To keep links working correctly, add all necessary path segments first
/
:CSS
URLs resolved in CSS are not impacted by
<base>
and therefore should not require any modification.