部分 3: Growing & Making Money
Keep your site fast — both humans and search engines don’t like waiting
3.1.1 Minimise plugins
Throughout this article we’ve recommended lots of plugins. They’re all valuable and can add to your site. However, don’t go over the top. Each and every plugin that changes your site appearance adds processing and transfer overheads. Plugins that are for management use only (e.g. 备份PLU-杜松子酒) are of much less issue. Wherever possible, 使用主题包括的功能, 或imple-换货解决方案没有PLU-杜松子酒, 例如, instead of using the “external links” plugin to apply style your external links, 简单地实现这个造型用自己一点点 CSS and an image or 2. Try to keep a sensible balance — don’t remove valuable plugins just to keep the number of plugins low, 但不要让那些你并不真正需要或者.
This is simple — if you’re not using a plugin then don’t waste hosting space on them. Unless you think you might want to reactivate a plugin in the future don’t just deactivate, but delete. Removing unneeded plugins also keeps your wordpress management page less cluttered.
有些插件是非常大的，有很多的功能, but you might only use one feature of such a huge plugin. Consider manually adding the code for that feature and ditching the overhead of the whole plugin (请参阅节 3.1.1) or consider finding an alternative plugin which offers just the features that you need.
3.1.4 缓存 & 运行如下
Your hosting will almost certainly be running on either the Microsoft of the Apache web server. Our host uses Apache, 它支持发送任何数据压缩, if you choose to enable it. The Microsoft web server also supports compression which can simply be turned on or off. All modern web browsers support compression. There are 2 与Apache COM-压力锡永的数据的方法, and you may only want to compress certain files. Here at DIYMH we compress all our text based files using apache’s mod_deflate. This reduces our front page load size from approx 100k to approx 20k! Depending on your web host you may only be able to enable some types of compression. BetterExplained have an Excel借给指南COM-压力锡永 which we recommend you read.
3.1.5 Keep scripts in files
3.1.6 使用 CSS 精灵
CSS 精灵是减少数量的好方法 HTTP requests sent back and forth between the readers browser and your web server. Instead of having 30 individual images, 这一切都必须reques - 泰德九月-AR-ately, you can reduce the number of requests to the server by having all of images in a single file. Use CSS to insert the correct part of the image each time you want to use it. Another benefit is that 1 large image file is often smaller than several small images combined. There is more information at CSSTricks, W3Schools的 and 粉碎 - 安泰马 - 气 - 国家统计局
3.1.7 Compress images
By default lots of images can be losslessly compressed better than wordpress does by default. This will save on image transfer times. There are plugins that will do this for you, e.g. WP Smush.it. If you’re using PNGs (作为推荐人内建于仲tion 2.1.2) then there are several ways to improve efficiency. To maximise PNG 效率的图像可以与PNGGauntlet被压缩, 怎么然而这是一定要做 后 upload. If the image doesn’t contain many shades or colours then save it as a 256-colour image — this will reduce the file-size significantly, 但同样, this efficiency should be sought after upload. The reason for not compressing or reducing the colour depth of images before upload is that the 的PHP resize function will not create good quality resized images if they are already compressed. So, 上传您的图片, 让WordPress的所产生的调整大小的图像, 带有向下加载它们 FTP 亲克, COM，按他们与PNG-冈特-LET, and then reupload and over-write the originals. 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 content that they load. To avoid images and other static resources being reloaded on every page load you can specify an expiry time which instructs the browser to use its cached copy until the expiry date passes, when it will fetch a fresh copy. Anything that doesn’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, 这意味着你将不必改变他们，如果你改变你的域名.
By default wordpress retains a copy of all previous revisions of every article on your site. This is overkill in our view. The easiest way to manage this is to use a plugin, e.g. REVI - 锡永控制, which will automatically cull older revisions based on your settings. This will keep your database size down and the speed of your site will benefit.
3.1.11 Check your page speed
虽然谷歌网页速度 (请参阅节 1.3.2) 是一个很好的起点, 我们使用的是建议的补 范围广泛的工具 检查你的Optim-ISED你的网站完全.
发现这个有用? 请不要让我们知道通过下降到低于评论. 如果您想订阅，请使用菜单上的订阅链接右上方. 您还可以通过使用下面的链接社会分享这与你的朋友. 干杯.