WP Rocket 2.10.3設置教程

1. Basic

WP-Rocket-Basic-Options

Lazyload – delays loading of images, iframes, and videos until you scroll down the page and they become visible (test to see if you like it or not). This significantly reduces load times and HTTP requests however the ongoing loading can be annoying especially for long content. This can also be done using other free plugins like Lazy Load and Lazy Load For Videos but WP Rocket does a great job. I have it disabled lazyload since I find it annoying.

You can also disable Lazyload on individual pages/posts using the sidebar:

WP Rocket Individual Settings

Mobile Cache – enable caching for mobile devices, but only “create a caching file for mobile visitors” if you are NOT using a plugin to create a mobile site (eg. free version of WP Touch).

User Cache – enable if users are logging into your site to interact with it (eg. bbPress). This gives each user their own cache, otherwise this should be disabled.

SSL Cache – enable if using SSL.

Emoji Cache – enable since these slow down your site, though you should probably disable these completely under Settings > Writing > Formatting, then do not convert emoticons.

Embeds – this is a new setting which I believe is similar to Cloudflare’s hotlink prevention(prevents sites from embedding your content on their website) which sucks up bandwidth.

Cache Lifespan – leave as the default (24 hours). If you rarely update your site or have a lot of static content, you can increase this a bit.

2. Static Files

WP-Rocket-Static-Files

Minify Files – ideally these should make all “minify” and “combining” items in your Pingdom and GTmetrix report 99 – 100%. Sometimes enabling these can cause issues with your layout (especially CSS and JS) so check a few pages on your site to make sure this doesn’t happen. If it does, find the problematic files and add them to either the exclude CSS or exclude JSS option.

Combine Files – just like minify, enable and test.

Exclude CSS – if for some reason a minification option messes up your site layout, locate the problematic file and add it here. See WP Rocket’s article on resolving issues with minification.

Exclude JS – same thing as previous settings only with JS.

Remove Query Strings – In GTmetix you will often see “remove query strings from static resources” which this should fix.

Render Blocking CSS/JS – enable and test.

Critical Path CSS – your page will start loading without CSS styles which is an item in Google Page Speed Insights. WP Rocket provides instructions for this but you just need to turn off WP Rocket, get your code from this CSS Critical Path Generator, then enter the code in this field.

3. CDN

Mirrors your site on multiple servers around the world which reduces the geographical distance it takes your content to reach your visitors. This can shave multiple seconds off your load time especially for visitors who (used to be) far away from your 1 origin server. support, and improved my Pingdom performance grades with the help of their team (definitely reach out to them!).

MaxCDN CNAME

Step : Paste your CNAME in WP Rocket’s “replace site’s hostname” field (also enable Cloudflare and MaxCDN if you’re using them). Use the SSL and rejected files if needed…

WP-Rocket-CDN

CDN & SSL – if you implement a CDN and your SSL pages have errors, you can eith enable this or follow WP Rocket’s tutorial on excluding your CDN on pages with SSL which suggests fixes.

Rejected Files – There may be certain files that are being served by the CDN that you would like to serve locally. Usually these files are parts of plugins designed to disregard cross domain load. To change this, simply add these files or directories into the “rejected files” area of WP Rocket (add one filedirectory per line) which you can use directives to locate WP directories.

Example:

  • {uploads_dir}/wpcf7_captcha/*
  • {uploads_dir}/imagerotator.swf

4. Advanced

The advanced options are mainly for excluding cart and checkout pages in eCommerce sites.

WP-Rocket-Advanced-Options

Never Cache (URLs) – if you’re using an eCommerce shopping cart not listed by WP Rocket (see the note they have in this settings), add your cart and checkout pages here. Learn more.

Always Purge (URLs) – let’s say you have a blogroll on your homepage. If you create a new post, you want that homepage blogroll updated immediately by emptying the homepage cache. That’s what this setting does, however WP Rocket automatically clears the cache for your homepage, categories and tags once new content is created… so there is no need for this. But if there are other page’s cache you want cleared when new content is added, add them.

Never Cache (Cookies) – same principal as previous option only based on cookies.

Cache Query Strings – mainly used to cache search result pages and price filtering pages for eCommerce sites.

Never Cache (User Agents) – prevents Googlebot or other user agents from caching pages. 

5. Database

WP-Rocket-Database-Setting

Post Cleanup – revisions, auto drafts, and trashed posts can be deleted if you don’t use them. Unless you have old versions of posts (or deleted posts) you would like to use, delete them.

Comments Cleanup – spam and trashed comments can be deleted.

Transients Cleanup – stores data that takes a long time to get (like social counts) so the next time you need it, it returns super fast. But sometimes when transients get expired they stay in the database and should be deleted. WP Beginner has a great explanation of transients.

Database Cleanup – when you delete a plugin it can leave unused tables in your WordPress database, which you can delete.

Automatic Cleanup – schedule WP Rocket to cleanup your database. Monthly is fine unless these accumulate quickly (eg. many people work on your site). If you have WP-Optimize or another database cleanup plugin installed, you can delete it since WP Rocket does this for you.

Run Cleanup – run it when you’re done. 

6. Preload

If you want to learn about preloading, WP Rocket has a simple tutorial. Or if you want to dig deeper here is an advanced tutorial which is about WP Super Cache but the same concepts apply. Preload, in somewhat simple terms, is a refresh when the cached pages are all cleared out and refreshed in one go. I would enable as it improves both site speed and indexing speed.

WP-Rocket-Preload

Sitemap Preloading – extends the benefit of preload to ALL URLs in your sitemap, not just your homepage and the internal links you use on the homepage. This does not use an external bot like the manual/automatic option… even if the end result is the same.

Sitemap Crawl Interval – leave as-is unless your CPU usage is high (shown in your hosting cPanel), in which case you should increase this number. If you don’t know, contact your host.

Sitemaps For Preloading – as long as WP Rocket detected your sitemap in the “sitemap preloading” option, there is no need to add it here.

Preload Bot – set to automatic unless you want to do this manually in the tools tab. Should this cause your site to shut down due to hosting CPU limits, you would disable this.

Here’s what the result of preloading can do for your server load…

CPU Usage

Prefetch DNS Requests – add Google Fonts, Youtube videos, or other scripts/requests from external websites to help browsers anticipate these. This will result in faster load times.

Add these if your site uses a Google font:

  • //fonts.lug.ustc.edu.cn
  • //ajax.lug.ustc.edu.cn 

7. Cloudflare

You do NOT need the Cloudflare plugin, just sign up for Cloudflare and use these settings. Cloudflare is a free service that improves both your speed and security. You should do this.

WP-Rocket-Cloudflare-Tab

Account Email – same email used in your Cloudflare account.

Global API Key – click your name (top right in your Cloudflare account) and go to manage settings. Scroll down and you will see your global API key, then paste this into WP Rocket.

Cloudflare Global API Key

Domain – yourwebsite.com

Development Mode – use when making a lot of code changes to your site.

Optimal Settings – activates optimal Cloudflare settings: minification, aggressive caching, and deactivates Rocket Loader for better compatibility. Most common issue is with Rocket Loader.

Relative Protocol – sometimes if people download files from your site, there are no contents in them. Leaving this option OFF will prevent this from happening.

Clear Cloudflare Cache – do this when you’re done configuring all WP Rocket settings.

8. Varnish

WP-Rocket-Varnish-Cache

Varnish Caching Purge – enable if your hosting uses varnish cache. If you’re on WP Engine orFlyWheel hosting, you will not see the Varnish tab because WP Rocket automatically takes care of this for you. If you are on SiteGround hosting you don’t need to enable this because WP Rocket already clears their cache when the WP Rocket cache is cleared.

9. Tools

WP-Rocket-Tools

Beta Testing – I don’t do this but you can if you want.

Clear Cache – do this when you’re dong configuring the WP Rocket settings.

Preload Cache – generates a cache for your homepage and all internal links you use on the homepage. I don’t worry about this since I have preload set to “automatic” in the preload tab.

Export Settings – export your settings to use on multiple sites.

Import Settings – import your pre-configured settings here.

Rollback – if you update to a new version of WP Rocket and it causes issues, this will fall back on the previous version.

最後分享一下WP_Rocket_[v2.10.3] 密码: np5k

相关推荐

发表评论

电子邮件地址不会被公开。 必填项已用*标注

微信扫一扫,分享到朋友圈

WP Rocket 2.10.3設置教程
返回顶部

显示

忘记密码?

显示

显示

获取验证码

Close