0

I recently asked a question, about a performance with jQuery (jQuery removing elements with event handlers).

I was worried about the event handlers in a deleted product list, but now I have similar issue with images. My program is still in development, so I added the same image for every product. My app is loading via HTTPS and I noticed a warning in the console:

The page at 'https://www.facebook.com/app/id?ref=ts' was loaded over HTTPS, but displayed insecure content from 'http://something.com/image.jpg': this content should also be loaded over HTTPS.

Of course, this is a meaningful warning, I understand it, BUT! When I update my product list it loads it again. When I update the page again, it warns for this problem 2 times, then 4 times, 8, 16, 32, 2^n...

I tried to delete my old content with .empty() function, but it doesn't make a difference.

This is mainly not an Error, but after some reloads, the number of warnings getting really high, and makes the browsing really slow, even if the actual network communication is pretty fast. There is only one requests, when I update the page, so I don't make 512 requests for an image :)

NOTE: When I say "update the page" I mean, I make an AJAX call, receiving some HTML and replacing the current content like this:

$.get('/inner/url', function(response){
    $("#content").html(response.data.html); // the response is a JSON with some more data
});

What should I do, to avoid this problem?

Community
  • 1
  • 1
seniorpreacher
  • 666
  • 2
  • 11
  • 31

1 Answers1

0

Serve your images over https- that's the only way to make sure you won't get that messge.

Max
  • 2,082
  • 19
  • 25
  • As I wrote, I understand this warning. This is just the fortunate situation, that I found this warning without wondering about the speed issue for hours :) So serving the image over https, would only hide the problem, what I can't solve. – seniorpreacher Jan 23 '14 at 20:20
  • What do you mean? I clearly am not understanding your problem- could you explain more in detail? – Max Jan 23 '14 at 21:08
  • So when I update the content, with the `.html()` function, it should delete everything, that was was there before. But when I update and I show the same image 12 times (12 products in a page) again then, I get the warning 2 times. Then refreshing again, 4 warnings, etc... even, when I update the old content, but it seams to me, that tries to do something with the old images. – seniorpreacher Jan 24 '14 at 10:10
  • I tried your solution btw. but now, I don't get the warning, but the performance issue still exist. – seniorpreacher Jan 24 '14 at 18:37
  • Are you using chrome? Check the network monitor to see if it's really re-downloading the images again, or just pulling them out of cache, if that's the performance issue you're talking about – Max Jan 28 '14 at 16:36
  • You are right, but I wrote about this too :) "There is only one requests, when I update the page" so it doesn't download the image several times. Sorry that I was not clear enough :\ And thanks for the help – seniorpreacher Jan 28 '14 at 18:22
  • I'm really not sure what the problem is- it's pulling the image out of cache, no? – Max Jan 28 '14 at 18:27
  • The most strange part, that I don't see any changes in the image, not a blink, just that warning when I load it over HTTP. and the exponentially slower performance, after some reloads. I mean it freezes for more and more time, after navigation. – seniorpreacher Jan 28 '14 at 19:01