Hacker News new | ask | show | jobs
by justwrote 4820 days ago
Just wondering, is it better to use relative or absolute URLs ?
1 comments

Technically, there is no difference at all in how they function.

But I only use //example.com/ if an API is truly available on both http and https (very unlikely, nearly all APIs should be on https only if they use some form of access token in the querystring for auth), and I only use https://example.com/ if the end point exists on some other domain.

As there is no technical difference I opt to save some bytes in the bandwidth.