NextStep
NextStep

Reputation: 1085

google hosted scripts , use http or https?

I am using google hosted javascripts libraries,(jquery ,jquery-ui & other google jsapi),and I noticed that these scripts can be accessed by both http & https schema.Now ,I want to know that what are the effects of using http or https schema to access these google hosted scripts , and for my projects ,it's just an ordinary websites ,using http as default schema, so ,what should I do ,http or https? Is there any performance issue between the two ?

Upvotes: 0

Views: 167

Answers (2)

mch
mch

Reputation: 1279

Check this out: HTTP vs HTTPS performance

The performance issue is rather small considering todays hardware and internet bandwidth. Personally I try to use the same protocol for all data used by one page (or iframe / frame), meaning scripts, CSS, images etc.

Data transferred over SSL will not be cached by the visitor's browser, instead will be downloaded each time a page is loaded.

Using SSL / HTTPS is recommended if a page contains sensitive data, personal data, or offers interactions like contact forms etc. Buying and installing a SSL certificate is justified in those cases.

Google analytics for example first checks which protocol your page uses, then uses the same protocol for downloading its scripts.

Upvotes: 1

Traxxus
Traxxus

Reputation: 871

https does affect performance negatively, as encryption and security negotiation aren't trivial tasks. In the vast majority of cases this performance cost is not significant enough to outweigh its benefits.

Remember that SSL also secures the identity of the web server and not just the channel.

If a "man-in-the-middle" spoofed the address of your script's location (for instance), https would prevent you from unknowingly executing unintended scripts. http would not.

Upvotes: 1

Related Questions