Closed lukewatts closed 7 years ago
To clarify, Postleaf uses root-relative URLs (e.g. /path/to/file.ext
) as opposed to relative URLs (e.g. 'path/to/file.ext`), so the browser simply prepends the hostname, which doesn't incur a performance hit.
The reason I'm using root-relative URLs is because it makes stored content and backup files more portable. You can effortlessly clone the site and move it between dev/staging/production and you only need to modify a single .env
file.
I'm closing this since storing absolute URLs doesn't provide any obvious benefit, but does make things more difficult. For example:
APP_URL
in .env
Even if there were a performance hit, it would be on the client-side. In this type of app, it would be negligible. 🙂
I see you're point about portability. Hadn't thought of that.
At the moment many of the URLs are relative in Postleaf .i.e
/themes/empower-theme/css/styles.css
There are some performance improvements by having absolute URLs instead.
http://website.com/themes/empower-theme/css/styles.css
Essentially the browser has less work to do to locate files with absolute URLs vs relative URLs.