开发者

Site blanks white when reload, how to avoid this?

开发者 https://www.devze.com 2023-03-28 15:19 出处:网络
Sadly my site is a little slow, especially its initialization calls (its another question). On a server, that (or something else) 开发者_StackOverflowcauses a little \"blanking\" effect, and the brows

Sadly my site is a little slow, especially its initialization calls (its another question). On a server, that (or something else) 开发者_StackOverflowcauses a little "blanking" effect, and the browser shows a blank white screen for too long. OK, its just a blink of an eye, but still disturbing.

How can I avoid avoid this?


Maybe you are calling too many (or too big) files in the head. Try calling javascript files (if any) right before closing the body tag. In fact, the browser can't render anything until it finishes dealing with the header, so it may be causing your problem. If you have a lot of css files, mergint into only one file could help too.

This tool could help you a lot with performance issues: https://github.com/farhadi/SmartOptimizer - I really recommend you to learn it and give it a try.


Try going to this page and putting in your site's URL to see if it can identify any big issues that might be causing the slow-down.

Also, take a look at the techniques mentioned here and make sure your site is using as many of them as possible.

If you have any specific question on how to implement the suggestions from the above links, try searching google, and if you can't find a good answer or still have some questions, ask another question here. :D


It's somewhat extreme for your use case, but you could conceivably have a "loader" page which would be a shell with the header/footer which would only be a few kb; and then in that page use ajax to load the slow page into a div with placeholder text like "The page will be loaded in a moment. Please hold."

0

精彩评论

暂无评论...
验证码 换一张
取 消