3 ms·
100% agree. Have been wondering this for a while. One way to do it would be to include an extra attribute on the script tag with a SHA1 hash of the library. Fo
by qeorge 15y ago
100% agree. Have been wondering this for a while.
One way to do it would be to include an extra attribute on the script tag with a SHA1 hash of the library. For example:
<script type="text/javascript" signature="24bdd1c96c20c3943054c146340243ccf88eef9e" src="http://myserver.com/js/jquery-1.7.js" ></script>
Old browsers would ignore the extra 'signature' attribute, while new browsers could check for that library in their included, pre-optimized list and skip the download if its found.
Seems like it would solve a lot of problems at once without affecting backwards compatibility.