Previously, the only way around this, would be hard code the HTTPS, which forces the HTTPS connection when the site is accessed in HTTP mode as well. This is an estimated 3.5% overhead over HTTP, per call. We could use JavaScript to use the appropriate protocol, and the Google Analytics plugin uses this exact technique.
However, there is another way and I had not seen this before until today. It is called protocol-less urls, and it looks like this:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript"> </script>
This means that the browser works out which protocol it should be using based on the page that loaded it.
It really works nicely, and more info can be seen here:
No comments:
Post a Comment