Web site speed program

Visit the slow pace of the Internet has become the past, but the page can be instantaneous only the future will show what is happening. Christianheilmann some skills, you can now visit the site together smoother.

First visit to the page when the delay is the Web site and Web application design encountered a very important question. Users always feel the corresponding page, not fast enough.
Why is there such a feeling of the user? Users also may be many years ago to retain the kind of billing per minute of access network the way the use of customary (now the hotel or airport is also to maintain the kind of access); may be because users feel that the pages are enough to have quick response can be called the so-called information highway. But I think this is the responsibility of Hollywood. In each area of action in Hollywood: tapping the keyboard at the same time, the computer screen will appear on ultra-high resolution, with numerous data showing exquisite site interface; and Web site to read a short period, however encyclopedia a few milliseconds to complete.
But in real life is completely not true, because no matter how you try to simplify your page, the delay still exists. But in order to make the page more brilliant, usually using flash, but if the abuse of flash will seriously affect the page response speed. As a network application, it is also necessary to ensure that the loading order of page elements will not be because the page has not been completely loaded element is caused by abnormal user access.

What are the factors in response to the slow site?

When it comes to improve Web site response time, the most usual practice is to document as much as possible to reduce the site size. (This also led to JavaScript library file against the size of endless discussion, but finally the result is no.) In fact, there are many factors will affect the website in response to the speed of the initial visit:

  • The size of HTML documents.
  • Embedded in the page script, images, multimedia elements in the document size.
  • The complexity of the HTML page. (Browser can quickly demonstrate a simple page)
  • User's access speed
  • Will be the third-party content page where the server access.
  • Website with the domain name and the page contains an external domain name DNS to resolve the speed.
  • A user's computer performance. (Because the browser will consume excessive system resources to other tasks become slow to respond).
  • The corresponding speed of the server.

Apart from the above technical factors will lead to Web site in response to slow, there are a number of human factors design. For example: in order to avoid the page to load the page appear in the process of regional disorder and non-image display; page is designed to fully load the required page displayed after.

Website will allow quick response to Ways

After practice, because of the following experience in solving technical and man-made factors have slowed the site to respond to questions will be helpful.

  • Without affecting the quality of page, under the premise of optimizing the HTML code as much as possible. (Which is included in the release page, remove the HTML document in the Notes, as well as redundant tag line. However, in order to guarantee the readability of the page, the code should also be retained in the source code)
  • Page that contains the lowest possible number of other external reference, to reduce dependence between documents. (Can be multiple scripts into a script file, using the sprite techniques CSS multiple small images into one big map, so only need to load first)
  • To ensure that you do not have to quote from an external server the contents of a third party: using a script to a remote RSS sources in the local cache. This will not only avoid the DNS to resolve the delay caused by, but also because the external server will not affect your service downtime.
  • As far as possible the formulation of images and contains elements of picture size. This can be avoided because of the page to show when the picture after another page element load caused by the phenomenon of beating.
  • The end of the page to load a large script, this page can be loaded in the script prior to the completion of display. If you put a large script on the page to load the first element, the browser will wait until the script shows fully loaded until the page content.

web development guidelines and improve response speed

Unfortunately, these terms referred to above Qiao and we normally think of web development guidelines are in conflict. Page contains documents such as reducing the quantity of products will cause deterioration of maintainability. In order to make the site do not have the page (home page, article pages, archive pages) to maintain a different page style of the simplest way is to different types of pages stored in a special style of their own style file. A page can have a basic style file, then in accordance with the different types of page and then type the page that contains the specified style in document.
Stored script can also be used the same method to function in a similar script file. This will help the code maintenance. You do not see all the script code can quickly find the function you need. In addition, the script to add the main part of page is generally considered bad coding habits, because he will be the user's behavior control logic embedded in the structure of the page.

Fortunately, there are technical solutions can solve these problems.

Contains references to a number of styles or scripts.

Edward Eliot proposed solution is to use a PHP script will be a number of CSS styles or scripts collated into a single file. This script can also call the javascript for DouglasCrockford's the JSmin compressed. This script is very simple to use and can be integrated into the cache file until these have been integrated into the document been modified. This means that when you modify a file after the merge, the script will automatically re-packaged cache. This very simple solution of the code maintenance and page conflict between response speed.

Solve the problem loading page

Another thorny issue is that the first element embedded in the page script and, if necessary, to wait for pages to load can be called upon completion. This will be some delay, but also create problems.

Delay is because of the browser to load, parse and display documents created by the way. When you use the window's onload event to load the script, the browser of the treatment sequence is as follows:

  • Analysis of HTML code loading external script and style sheet
  • Implementation of the scripts have been parsed
  • HTML set up the DOM tree
  • Loading images and other external reference content
  • Page has finished loading

In most cases this will be relatively slow to load, and some of the steps required in advance. Many clever programmers committed to resolve this issue, from time to time there will be new solutions arise. Most of the javascript script will have onDocumentReady for onAvailable or deal with the incident. Such incidents will be part of the document will be loaded after the completion of the trigger, rather than wait for a large number of photographs have been loaded. However, through practice and repeated tests, for the old browser and operating system did not watertight solution. But I believe as long as we continue our efforts, combined with luck it will find the ultimate solutions.

For web applications did not load because of call completion and lead to abnormal elements are very deadly problem. If these problems happen to beautify parts of the page, there are some solutions.

Too much time to load in order to solve the content problem, you can adopt on-demand content is loaded separately.

In order to better decorative page loading time a lot of content, often have questions. May have substantial contents of each tag contains too many characters have 4 or a navigation bar. Use javacript script can easily display dynamic content. However, if the script is disabled, dynamic content will lose these styles have been disrupted and can not properly displayed, and this is not a good idea. Page there is no need for a dynamic display of all the contents of a load, this will increase the load on the page loading.

Solutions are triggered when a user tags when re-use javascript to load dynamic content display. When users turn off scripting will also be displayed after a basic static text.

How to load the extra content required depends on what you quoted is. The easiest way is to dynamically generate script tags. This is a very early method was used to introduce a lot of javascript data sets or re-introduced after the page loads the script.

function pull () (
var s = document.createElement ( 'script');
s.type = 'text / javascript';
s.src = 'largeJavaScriptBlock.js';
document.getElementsByTagName ( 'head') [0]. appendChild (s);
window.onload = pull;

page on del.icio.us to the introduction of this method to return json data. Json But because of the back are a bunch of javascript code, you can load the page after the completion of javascript to generate a script tag that contains the code; then the implementation of these codes to replace the original page content of an element. Dishy as a json object encapsulates Allows you to easily complete these. Another Liezi are Less prominent portrait Flickr , Flickr using json output shows you the latest photos, when a user disable script, which shows only the location of a link.

If you want to introduce a non-javascript, you can use Ajax or ahah Hijax or xml or other does not contain the ajax (referred to as what you are willing to put another name). For example, a Implementation using ajax navigation It can even necessary in accordance with the user can choose to load more complex interface.

Imaging trickery image display skills

Finally a method of origin will be traced back to contact you may have begun when the website development. Was the browser war in the most competitors ie plays the role of ill of Netscape (but I think that time is still good) browser support for a custom HTML attribute 'lowsrc', this property can specify a small picture ahead of time to load as large map loading alternative display picture. So even if the user's access speed is slow, we can see is about to show a preview picture.
You can reuse this idea, when the page is loaded, do not embed the picture is too large but more standardized loading small picture; such as the page loads after the completion of the replacement of large pictures. You can even simplify the time to start loading only the background color, and then complete the re-use, such as page loading javascript or DOM load cover artwork.
This approach also applies to a number of servers you need to get much of the picture should not be cached. (For example, gravatars) can often be a placeholder before loading the images, such as dynamic page is loaded after the completion of other servers to obtain dispersed in small picture.
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of Web site speed program

  • JQuery plug-ins

    Keywords: jquery ajax Posts other people's good, for fear of lost some of its own copy Overview jQuery is the second prototype was followed by an excellent Javascript framework. Its purpose is to - write less code to do more things. It is lightweight

  • A server simultaneously run multiple different versions of Rails application [to Taiwan thegiive article]

    http://lightyror.thegiive.net/2007/04/rails-version.html, following its original content. Rails site now using, Version divided into several faction. 0.x 1.0 1.1 1.2 Rails 0.X is a few years ago began to use the Rails at the ancestor of the domestic ...

  • html-css-javascript dhtml associated

    html: Hyperlink Text Markup Language, used to display text in some format in the browser. On the page displays the effect of control is not strong. More difficult to make a more beautiful more dynamic effect, the text was transmitted to the client ca ...

  • Firebug Guide (four) --- how to use the Firebug command line API to provide debugging js procedures (below)

    Introduction: Firebug command line are in one of the most useful features. If you have been using Visual Studio (referred to as VS) the experience of development projects, they should know you in the use of VS debugging procedures, "the immediate win

  • Pages 14 to accelerate the optimization of the rules

    Rule 1. To reduce the number of HTTP requests 80% of the end-user response time spent on front-end process, but most of their time is spent on the various page elements, such as images, style sheets, scripts, and Flash, etc. of the download. To reduce the

  • Ajax and the XMLHttpRequest object

    XMLHttpRequest object components are XMLHttp through this object, Ajax can be the same as desktop applications with the server only the exchange of data layers without having to refresh every time interface, the data do not have to deal with each of ...

  • Rails to monitor the process of memory leaks skills

    Rails applications easier to encounter two types of performance problems: Rails implementation of a class are very slow, CPU consumption too high; The other is the process of memory leaks Rails. To resolve these two types of questions are necessary before

  • js commonly used in integrated

    / / Open the model dialog box function doSelectUser (txtId) ( strFeatures = "dialogWidth = 500px; dialogHeight = 360px; center = yes; middle = yes; help = no; status = no; scroll = no"; var url, strReturn; url = "selUser.aspx"; strRetu

blog comments powered by Disqus
Recent Entries
Tag Cloud
Random Entries