Advertise

Tuesday, 11 September 2012

Make website faster(feel or look like)


What we Focus Today

Want website look like faster?provide visual feedback faster? load DOM first! put javascript and css file at the bottom

we can make website loading faster by changing a lot thing.Such as Minimize HTTP Requests,Use a Content Delivery Network.......(want more? go to Best Practices for Speeding Up Your Web Site)


But today,we just do some little trick, let user feel faster.


So how to do that? we just put our external link(like css or javascript) at the bottom of file.After that, the browser will load the DOM fist, then it load external file.When we do that,user can get response as soon as possible. Otherwise,browser load javascript file,css first, it require a lot of time(as CDN network may be down, file is too big).


the philosophy behind that ,when user browse website, what they can see? just html page, CSS? javascript? they can can't "see".


HTML page is the progress indicator! When the browser loads the page progressively the header, the navigation bar, the logo at the top, etc. all serve as visual feedback for the user who is waiting for the page. This improves the overall user experience. by Best Practices for Speeding Up Your Web Site

DrawBack

if you put CSS file at the bottom,user may see the page without any style,layout. If you produce some javascript or jquery function to hide some image or paragraph, and you put javascript file at the bottom, the page will show all thing that you want to hide, then hide it.

Conclusion

Before you put external link at the bottom, you should decide put what file carefully. the file about visual effect, you should put it at the top

0 comments:

Post a Comment