3 ms·
The technically correct fix is for the site owner to modify the page to load all these resources over https when the page is accessed over https. The easiest w
by sp332 15y ago
The technically correct fix is for the site owner to modify the page to load all these resources over https when the page is accessed over https.
The easiest way to do that is with protocol-relative URLs. You're probably familiar with relative paths in URLs, e.g. if example.com/test/test.html loads an image at pics/pic1.png, it will really look in https://example.com/test/pics/pic1.png https://example.com/test/pics/pic1.png if you loaded it over https, or http: if you loaded over http.
Simple, right? Well, you can use the same idea for absolute paths and even resources from other sites! So if a different site links to the URL //example.com/test/pics/pic1.png (note the lack of protocol before the double-slash), then it will use https: if you loaded the page over https and http: if you loaded it using http.
- JoshTriplett 15y agoBetter yet, redirect all http URIs to the corresponding https URIs, and serve everything over https.
- WickyNilliams 15y agoThat is not a better approach, there are issues with client-side caching if all resources are served over HTTPS. See http://encosia.com/cripple-the-google-cdns-caching-with-a-single-character/ http://encosia.com/cripple-the-google-cdns-caching-with-a-si...
- JoshTriplett 15y agoEasily fixed by serving up a Cache-Control header, as documented in the page you linked to.