The main reason for using these URLs is on a site that uses HTTP and HTTPS (with the same page). The idea is that links to static content on the page use // instead of http:// , inheriting the protocol from the page. This allows the client to add the correct protocol (so that the protected pages do not have “unsafe elements”) and eliminates the need to encode two versions of the page or has special “tricks” to change the protocol when creating the page.
For any URL other than this, without adding a protocol, this means that users can directly come to your site with an HTTPS request, adding unnecessary load to your site. I suggest explicitly specifying the protocol in such cases.
Regarding the question of using www or not, it depends on what else you will have on the server, and if you expect subdomains (if you add a blog, it will have blog.example.com URL or example.com/blog URL). If you expect subdomains, use www to designate the main site, if you cannot omit it.
Odded source share