部分 3: Growing & Making Money

3.1 Performance

让您的网站快速 - 人类和搜索引擎不喜欢等待

3.1.1 Minimise plugins

Through­out this art­icle we’ve recom­men­ded lots of plu­gins. They’re all valu­able and can add to your site. How­ever, don’t go over the top. Each and every plu­gin that changes your site appear­ance adds pro­cessing and trans­fer over­heads. Plu­gins that are for man­age­ment use only (e.g. 备份PLU-杜松子酒) are of much less issue. Wherever pos­sible, 使用主题包括的功能, 或imple-换货解决方案没有PLU-杜松子酒, 例如, instead of using the “extern­al links” plu­gin to apply style your extern­al links, 简单地实现这个造型用自己一点点 CSS and an image or 2. Try to keep a sens­ible bal­ance — don’t remove valu­able plu­gins just to keep the num­ber of plu­gins low, 但不要让那些你并不真正需要或者.

3.1.2 删除未使用的插件

This is simple — if you’re not using a plu­gin then don’t waste host­ing space on them. Unless you think you might want to react­iv­ate a plu­gin in the future don’t just deac­tiv­ate, but delete. Remov­ing unneeded plu­gins also keeps your word­press man­age­ment page less cluttered.

3.1.3 更换插件

有些插件是非常大的,有很多的功能, but you might only use one fea­ture of such a huge plu­gin. Con­sider manu­ally adding the code for that fea­ture and ditch­ing the over­head of the whole plu­gin (请参阅节 3.1.1) or con­sider find­ing an altern­at­ive plu­gin which offers just the fea­tures that you need.

3.1.4 缓存 & 运行如下

Word的新闻是基于 的PHP 和MySQL, and both of these require sig­ni­fic­ant pro­cessing whenev­er a page is accessed. Since neither users nor search engines like wait­ing for pages to load you should reduce load times by util­ising vari­ous cach­ing and effi­ciency plu­gins. Cach­ing gen­er­ates stat­ic HTML 为您的每个网页文件, redu­cing the delay caused by your web serv­er pro­cessing 的PHP and access­ing the data­base. Mini­fy­ing removes redund­ancy from your CSS and JavaS­cript. The 2 铅ING解决方案是 W3的总缓存, 这同时做两件事缓存和涅槃或组合 WP 超高速缓存 and WP Mini­fy.

3.1.5 压缩

Your host­ing will almost cer­tainly be run­ning on either the Microsoft of the Apache web serv­er. Our host uses Apache, 它支持发送任何数据压缩, if you choose to enable it. The Microsoft web serv­er also sup­ports com­pres­sion which can simply be turned on or off. All mod­ern web browsers sup­port com­pres­sion. There are 2 与Apache COM-压力锡永的数据的方法, and you may only want to com­press cer­tain files. Here at DIYMH we com­press all our text based files using apache’s mod_deflate. This reduces our front page load size from approx 100k to approx 20kDepend­ing on your web host you may only be able to enable some types of com­pres­sion. Better­Ex­plained have an Excel借给指南COM-压力锡永 which we recom­mend you read.

3.1.5 Keep scripts in files

All non con­tent really should be in extern­al files, 未加载内嵌. This speeds up browser ren­der­ing sig­ni­fic­antly and also makes debug­ging any page errors easi­er. JavaS­cript should be in js files, STYL-ING应在 CSS files etc. Even some meta con­tent can go in extern­al files (例如见仲系统蒸发散 1.4.3 and 1.4.17).  Word­Press is very good at keep­ing to this, but if you make modi­fic­a­tions try to stick to the sys­tem. Some word­press plu­gins are bet­ter than oth­ers at this, 所以,如果有些不达到标准, CON-Sider的发现ing一个替代.

3.1.6 使用 CSS 精灵

CSS 精灵是减少数量的好方法 HTTP requests sent back and forth between the read­ers browser and your web serv­er. Instead of hav­ing 30 indi­vidu­al images, 这一切都必须reques - 泰德九月-AR-ately, you can reduce the num­ber of requests to the serv­er by hav­ing all of images in a single file. Use CSS to insert the cor­rect part of the image each time you want to use it. Anoth­er bene­fit is that 1 large image file is often smal­ler than sev­er­al small images com­bined. There is more inform­a­tion at CSSTricks, W3Schools的 and 粉碎 - 安泰马 - 气 - 国家统计局

3.1.7 Compress images

By default lots of images can be losslessly com­pressed bet­ter than word­press does by default. This will save on image trans­fer times. There are plu­gins that will do this for you, e.g. WP Smush.itIf you’re using PNGs (作为推荐人内建于仲tion 2.1.2) then there are sev­er­al ways to improve effi­ciency. To max­im­ise PNG 效率的图像可以与PNGGauntlet被压缩, 怎么然而这是一定要做 upload. If the image does­n’t con­tain many shades or col­ours then save it as a 256-col­our image — this will reduce the file-size sig­ni­fic­antly, 但同样, this effi­ciency should be sought after upload. The reas­on for not com­press­ing or redu­cing the col­our depth of images before upload is that the 的PHP res­ize func­tion will not cre­ate good qual­ity res­ized images if they are already com­pressed. So, 上传您的图片, 让WordPress的所产生的调整大小的图像, 带有向下加载它们 FTP 亲克, COM,按他们与PNG-冈特-LET, and then reup­load and over-write the ori­gin­als. WP Smush.it将让你 90% 的方式,是更浓度韦尼-ENT. 我们总是在本地重新压缩我们的PNG图像与PNGGauntlet, but you may not want the hassle — the choice is yours.

3.1.8 Set expiration of static resources

Browsers cache all the con­tent that they load. To avoid images and oth­er stat­ic resources being reloaded on every page load you can spe­cify an expiry time which instructs the browser to use its cached copy until the expiry date passes, when it will fetch a fresh copy. Any­thing that does­n’t change very often should have an expiry set. At DIYMH we do this via W3 Total Cache.

3.1.9 Use relative links

如果插入到任何东西在您的网站的任何链接总是使用相对路径, 而不是一个完整的路径. 这节省了页面大小一点点, 但更多的进口antly, 这意味着你将不必改变他们,如果你改变你的域名.

3.1.10 删除旧版本

By default word­press retains a copy of all pre­vi­ous revi­sions of every art­icle on your site. This is overkill in our view. The easi­est way to man­age this is to use a plu­gin, e.g. REVI - 锡永控制, which will auto­mat­ic­ally cull older revi­sions based on your set­tings. This will keep your data­base size down and the speed of your site will benefit.

3.1.11 Check your page speed

虽然谷歌网页速度 (请参阅节 1.3.2) 是一个很好的起点, 我们使用的是建议的补 范围广泛的工具 检查你的Optim-ISED你的网站完全.

你怎么看? 请给我们一个评论如下! 如果您想订阅,请使用菜单上的订阅链接右上方. 您还可以通过使用下面的链接社会分享这与你的朋友. 干杯.