by btrettel · 6y ago · 0 comments
- Use relative URLs when possible, i.e., /page.html, no need to specify the protocol.
- Use shorthand CSS properties like font, background, margin, border, padding, and list.
- Use lowercase tags as they compress better. See: https://encode.su/threads/1889-gzthermal-pseudo-thermal-view...
- Use shorthand hex colors.
These optimizations are harmless compared against some of the ones recommended in the linked article...
Protocol relative URLs can also be used for different domains as long as protocol remains the same, which is often the case with https: so widespread, e.g.:
<script
src=//code.jquery.com/jquery-3.5.1.slim.min.js
integrity="sha256-4+XzXVhsDmqanXGHaHvgh1gMQKX40OUvDEBTu8JcmNs="
crossorigin=anonymous>
</script>But you're right; relative by itself would refer to relative to the current location. Error on my part in not being specific enough. In retrospect "site relative" is not good terminology.
Example, for "http://mysite.com/dir/page1.html":
* Relative: "../other_dir/page2.html"
* URL relative: "/other_dir/page2.html"
* Absolute: "http://mysite.com/other_dir/page2.html"