When I use tools.pingdom.com, I can see that my website is loading twice unnecessarily. The first time www.junkluggers.com is loaded, a cookie is set. Then part way through the loading process, www.junkluggers.com is loaded again, this time containing the cookie that was previously set and cached. I'm assuming this double loading is unnecessary. How can I prevent it?

The test: http://tools.pingdom.com/fpt/#!/dQNuas/http://junkluggers.com

The first loading: enter image description here

The second loading, now with the cookie: enter image description here

  • Could it be that there is some redirect happening? Does sound like a server configuration issue or a theme or plugin doing something very wrong. – kaiser Oct 19 '14 at 13:44
  • This seems to be pretty basic redirect from non–www to www version. Note that technically they are completely different domains and redirecting to one version is normal practice. – Rarst Oct 19 '14 at 17:11
  • Rarst, when I tested it I, I put in the non-www url. It seems to redirect to www properly (this is the first thing that happens), then a bunch of stuff loads, then it loads the www url a second time, then it finishes loading stuff. I'm going to check the registrar to make sure all is in order, then the server configuration, but I suspect is probably something else, like an errant plugin, etc. – Jason Hartley Oct 19 '14 at 22:41

As I've found, this happens when your html, css or javascript tries to load a resource and you haven't specified a path or wrongly specified root.

For instance, I've seen examples on people having this problem while doing

<img src="http://example.com" />


In my case specifically, was assigning $.ajax() to a global variable so I could work with it later, like this

var map_markers = $.ajax();

clearly I don't know enough javascript, regardless, this $.ajax() was causing the site to load twice.

Hope this helps someone googling. If you suspect this is happening, http://tools.pingdom.com/ will show you what loads in your site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.