MikeNQ
MikeNQ

Reputation: 653

Https page access non-https resource

I am deploying a Tomcat service with the purpose of storing web static resource and libraries (Jquery in particular). This service provide resource for a website with https while Tomcat service is deployed with normal http, thus the browser block Tomcat resource and prevent the page to load properly.

And I can't stored static web resource on the server that hosted the main website.

I was suggested to enable https for Tomcat but that will cost me some performance for the website. Is there a better solution for this?

Thanks, Minh nguyen

Upvotes: 1

Views: 89

Answers (1)

Cody A. Ray
Cody A. Ray

Reputation: 6017

The simplest solution is to use Google's hosted jQuery library, if that's all you need.

If that's not acceptable, then you might consider using Apache or Nginx for hosting your static content instead of Tomcat (which is a container for dynamic web apps written in Java). Both of these suggestions are much more commonly used for this use case and there are an abundance of options for optimizing your performance.

That being said, using HTTPS will always have some performance impact regardless of the web service used. This is because most of the performance overhead of HTTPS connections are associated with the SSL handshake (which involves some minor cryptographic signing, if I recall). However, this impact is relatively minor in the scheme of things. For static files that change infrequently like jQuery, you can set the proper caching headers on the files and reduce this impact even more. (Again, this configuration is easier done in Apache or Nginx than Tomcat.)

Upvotes: 1

Related Questions