Page gets stuck on the first upload. After refresh it works normal. If you clear cache, it restarts

-1

This problem is attacking me for a few days already .. I researched and did several checks and changes and I can not find the problem.

The page gets stuck in loading for some reason.

  • If you go to the 'inspector' you will see that the page is loaded in html, however it does not render and it gets a 'WHITE', although the links appear when you mouse over; li>

  • After refresh, the page loads and works normally .. and it continues to work until the cache is cleared, then it crashes again;

  • The strange thing is that it does not give any console error or anything;

  • This problem occurs in multiple browsers and other computers in different places;

See for yourselves:

ps: unless you change the useragent you can not test accessing with mobile, because you will be redirected to the mobile site, where you no longer have this error

link

Thank you

    
asked by anonymous 05.04.2017 / 17:16

1 answer

1
  

Your page only uploaded after I clicked "stop loading" the browser and then "Refresh"

It was really a matter of organizing the scripts against others and the jquery library, with a php file in the middle.

I used a php file to include several scripts, and for some reason I did not identify right, some of these scripts, including a jquery library was loaded in the cache the first time it was loaded, and loading the site crashed while downloading this library. So, the second time on, the site was accessed, it worked normally and even carried faster, because the necessary files were already in the cache. Clearing the cache gave the same problem.

The problem was difficult to identify because it did not give any error. The CLONE of @Leo Caraciiolo helped a lot, because the clone was not a problem and I could see that it was something that happened when I downloaded these scripts included in the php file, because in the clone, the scripts were already included in the code.

Well, so I took all the scripts out of the php file, and reorganized my scripts following this document:

  

link

Conclusion: 1. I have used php files several times to generate dynamic scripts, but at least this technique is indispensable, it is not a good practice to use it. In addition to slowing the load may give page blocking problems.

  • Organization of scripts is very important and directly connected with the performance of the page. Pay attention to this.
  • 07.04.2017 / 21:29