7 tips to speed up website
Researching computer use habits suggests that users will switch to another page if the website does not have "static" after 4 seconds. Therefore, speed is an important factor and also a competitive advantage to provide information.
7 tips below will significantly increase your website.
1. Move the host file or large image host to another location
Many people online at the same time can block your connection with lots of requests to view the same picture on the website. Data burdens can be transferred to websites dedicated to storing and sharing photos like ImagaShack, Photobucket or Flickr. This way, your web server only needs to make sure the text and image files are small, significantly reducing bandwidth, which means serving more people at once.
If you want to share small files, about 2 - 5MB, with visitors, you can use Google Pages services as a secondary web server.
2. Optimize CSS code
Currently, many websites start using CSS (Cascade Style Sheet) to format. Although CSS tables look more eye-catching and efficient than HTML table formats, it requires you to optimize their code to achieve optimal speed. The 'clean' CSS code will help the browser decode the page faster.
For example: Instead of writing:
margin-top: 20px;
margin-right: 10px;
margin-bottom: 20px;
margin-left: 10px;
You should write:
margin: 20px 10px 20px 10px;
According to Yahoo optimization experts, CSS codes should be placed at the top of the web. This is especially meaningful if your site is large and has many objects. If you place the CSS at the bottom or center of the web page, the browser will use the default format to display it, then re-format it with CSS. That requires more computational time and of course users will be annoyed to see a website burst when not shaped. Even, some browsers also prohibit placing CSS at the end of the website.
If you're not familiar with the code, the Clean CSS online tool will help you optimize this process, eliminating redundant declarations and meaningless gaps. You can refer to here.
3. Optimize images
There are 4 types of image formats commonly used on the web: PNG, JPG, / JPEG and GIF. Most image processing software like Adobe Photoshop has a 'Save for Web' feature to optimize the ratio between image quality and file size.
4. Declare the image size
Many 'forgotten' programmers declare the height and width tags of images when writing HTML code. These two parameters tell the browser the size of the image before the data is downloaded. If not declared beforehand, the browser must calculate the size by downloading the entire image, then the other data.
When the image declaration is full of tags, the browser will take a space that fits the image size and continue loading the data. Thus, the viewer can read the text immediately while the image continues to be displayed partially.
5. Minimize use of Javascript
The animation effects of Java script are very eye catching and many people tend to put them on their website. However, using too much Javascript can make the browser hang hard, which makes the user annoyed. Must consider carefully before using them.
The placement of script code is also quite important for the display speed. Advice of professional programmers: only to really important scripts that affect the whole page to the top, and other effects (animation, statistics, .), then drop to the bottom of the page.
The inclusion of Javascript and CSS on external links is better than inserting directly into the site. These files will be stored in your browser's cache and users will not have to download them again whenever needed. It significantly reduces the time and bandwidth of servers and users.
6. Link optimization
Notice that every link placed on your website or blog is written in a concise and accurate way. For example, every entry on 360 Yahoo has a 'Permanent Link' section to get a much more accurate and neat link than what is displayed on the browser's address bar. Accurate use of the link will reduce unnecessary requests for the server in some cases.
7. Reduce HTTP requests to the server
When opening a website, every object on the page (images, scripts, drawings, lines, .) creates a request to the server to download. Of course, the more objects, the longer the download will take. So, minimize the number of objects on the same page and try to include CSS files with scripts.
Hung Hai
- Tips to speed up Internet on Windows computers
- 4 steps to speed up Android simply without using the application
- 4 tips to help Google Chrome run faster
- Speed up access, website must pay for ISP
- Introducing some cooking tips
- Discover super useful tips in everyday life
- 3 tips everyone should know when cooking
- Website '1 million' has legal trouble
- Fix the situation of Windows 10 computer slowly
- The first website in the world is 25 years old
- How to clean the scale in the kettle quickly
- Extremely strange but extremely useful tips from rice