All of google's CDN libraries are served via https. Is there any advantage of serving them via https over http ?
cdhowie is correct. If your page is served via http, then serving the library via https merely adds a small amount of overhead. If your page is served via https, then serving the library via http would be a potential security hazard, and most browsers will issue a warning. So https is given as the default option.
See this related question: HTTPS and external (CDN) hosted files?
But you can have the best of both worlds by omitting the protocol entirely, e.g.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
That tells the browser to automatically use the same protocol that was used to serve the page. Little-known trick, but widely supported. More info here: Is it valid to replace http:// with // in a <script src="http://...">?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With