The main points of the front-end optimization for DISCUZX

Source: Internet
Author: User

This article for the Jincheng Bar technical team original, forwarding do not delete this article link.

Jincheng Bar Server in the United States, the delay relative to the domestic slightly higher, so optimization is very important. Recently, the DX version of Kangsheng is basically determined, at least in the short term will not change greatly, therefore, I to Jincheng bar of the whole station for the front-end optimization, the operation of their own record down, one has a record, to prevent forgetting, and the second is to share with the online friends of their own experience.

Front End Optimization Recommendation tool

Firefox browser +yslow+google pagespeed+firebug specific download address please own Baidu

First, the DX background and DIY optimization

1. Home DIY Avoid too many layers of nesting

Each of the DX's frames produces very much, much more code. My home page has been as simple as possible, the result of light DOM has 1600 +, embarrassing me.

So, try not to use too many frames to nest

2. Avoid excessive user avatar calls

Homepage member call is to use redirects, will slow down the speed of the page, Ucenter can be changed to pseudo static, but there is a bug, no custom avatar member Avatar is unable to display

3. Open gzip

In the background of the Web site or to the config.php file will be gzip opened

4. The background map is reused as much as possible to reduce the number of background maps

The background of each column as much as possible, so that you can reuse the picture, to find the balance between the beautiful and speed, this one, I actually also in the constant attempt, here recommend the Monitoring Treasure server access speed tracking, you can grasp the overall site by the user when the speed of the situation.

5. Open and set up the background of the various optimizations and caching

A lot of information on this, I do not waste time here, (by the PIA Fly ~ ~ ~ ~ ~)

Ii. Code and Space optimization

1. Use minify compression to merge JS

DX's CSS basically merges very well, one page to 2, but JS is a lot of. Open your template to the common directory of Header.htm, see. Dense JS, and too much of the file will cause too many connections, slowing down speed.

Here we use minify to merge it into a compressed cache

First of all, download the minify compression package, decompression, the Min folder uploaded to the site root directory.

Then modify the 2 files:

The groupsconfig.php under the 1.min folder

<?php
/**
* Groups configuration for default Minify implementation
* @package minify
*/
/**
* Wish to use the Minify URI Builder app to suggest
* Changes. http://yourdomain/min/builder/
**/
Return Array (

Add the following code behind the code above

    ' portal ' => array ('//STATIC/JS/C Ommon.js ', '//static/js/home_friendselector.js ', '//static/js/forum.js ', '//static/js/portal.js '),
              
                ' Forum ' => Array ('//static/js/common.js ', '//static/js/ Home_friendselector.js ', '//static/js/forum.js '),
               
                 ' home ' => Array ('//static/js/common.js ', '//static/js/home_friendselector.js ', '//static/js/ Home_cookie.js ', '//static/js/home_common.js ', '//static/js/home_face.js ', '//static/js/home_manage.js '),
                  
                     ' Userapp ' => array ('//static/js/common.js ', '//static/js/home_friendselector.js ', '//static/js/ Forum.js ', '//static/js/home_common.js '),

2. Modify the header.htm of the template

What the?? Where is this file???? I was beaten by you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.