
Your InMotion Central production site will have the ability to use NGINX caching, this can result in faster website performance since it does not have to generate content in real-time. You can select from pre-configured profiles that are built for specific types of websites. Then you can set your purge settings using a plugin such as NGINX Helper or W3 Total Cache.
This ensures your visitors are seeing the latest version of your website and not old cached content. In this guide, we’ll go over the UltraStack Utilities that are available on your server to help you manage your cache settings via SSH. Then we’ll show you how to select your caching profile and manage your cache settings using NGINX Helper and W3 Total Cache.
- Cache Profile Options
- Set Caching Profile
- Managing Cache From the WordPress Dashboard
- Managing Cache With SSH
Cache Profile Options
Below is a breakdown of the available profile options that you can choose from.
Profile | SSH Command | Description |
---|---|---|
No Caching | no_caching | Turns caching off but you will still have static content acceleration and brute force rate-limit protection running. |
WordPress | wordpress | General-purpose profile compatible with most WordPress and WooCommerce site, but it is recommended to use a cache-control plugin such as W3 Total Cache to handle purging (clearing) the cache when content is updated. |
WordPress Multisite | wordpress_multisite | This is the same as the WordPress profile but built specifically for Multisites (Networks) but allows Apache to perform required path rewrites by disabling Accelerate Static Content. Note: This is the best option to use with W3 Total Cache, because it would allow minify and concatenate functions to work appropriately and you can set the page cache to store on disk, which would serve it from NGINX cache directly before reaching the application level on request. |
WordPress Microcache | wordpress_microcache | Recommended for sites where full page caching is not a good option due to the dynamic nature. This can help neutralize high increases in traffic to your site. |
Pass All | pass_all | Select this to pass all traffic to Apache in case you do not want to utilize any caching, ratelimit protection, or optimizations. We recommend using the No Caching profile instead if you want to disable caching. |
Honor Headers | honor_headers | As per InMotion Central, this profile “Honors the Cache, Expires, and X-Accel-Expires headers set by the application. If not set, a default 60 second expiration time is used. All other values match the WordPress/Generic profile.” Note: This can be used with Total Cache effectively as well, because it allows you to modify or customize the response headers to control cache on the client-side, server, and CDN levels. |
Set Your Caching Profile
Set Caching Profile From InMotion Central
InMotion Central includes pre-configured NGINX profiles that are custom-made for specific website needs. Here are the steps to easily select the one that best suits the type of site you are building.
- Login to InMotion Central.
- Roll your mouse over the project you want to manage and click The Bridge button.
- Click Environment and select the one that is associated with your server.
- Click the Manage Server link in the navigation menu.
- Click NGINX Settings.
- You will then see a list of the available NGINX profiles, for more information see the section above on Cache Profile Options. Select the one you want to use then click the Update Profile button.
- Click the Update Profile button to save your NGINX settings. The playbook will then run and setup the new NGINX profile for your server.
Set Caching Profile With SSH
Connect to your server via SSH and run the following command to select your caching profile. For more information see the section above on Cache Profile Options.
usutil -u USER -d DOMAIN -p PROFILE
Example:
usutil -u root -d https://example.com -p wordpress_multisite
Managing Cache From the WordPress Dashboard
Now that you have your NGINX profile selected you can manage your cache using a WordPress plugin. NGINX Helper will be installed automatically but for more control, we recommend using W3 Total Cache. We’ll now go over how to use both plugins to manage your cache-purging settings.
In this section, we’ll show you how to manage your cache from your WordPress Dashboard using the NGINX Helper and W3 Total Cache plugins.
Using NGINX Helper
NGINX Helper will automatically be installed on your site, so you just need to access and choose your purge settings.
- Login to InMotion Central.
- Roll your mouse over the project you want to manage and click The Bridge button.
- If you have multiple environments, you may have to click Environment and select the one that you are working with.
- Click the WP Admin link in the navigation menu to access your WordPress Dashboard.
- Click Settings then NGINX Helper.
- Check the box to Enable Purge.
- You can then select your Purging Conditions as needed.
- Click the Save All Changes button after choosing your settings.
Using W3 Total Cache
W3 Total cache can be easily installed right from InMotion Central, then you can manage your cache directly from your WordPress Dashboard.
- Login to InMotion Central.
- Roll your mouse over the project you want to manage and click The Bridge button.
- If you have multiple environments, you may have to click Environment and select the one that you are working with.
- Click Optimize then Page Speed in the navigation menu.
- Click the Open Dashboard button to visit the Performance page in your WordPress Dashboard.
- Once logged into your Dashboard I recommend clicking the Setup Guide link in the Performance section. It will walk you through testing and the initial setup process.
Managing Cache With SSH
If you prefer to use SSH instead of a plugin to manage your cache, you have the ability to clear all cached data or just a single page.
Purge All Cached data
usutil --purgeall -Z
Purge Cache For a Specific page
usutil --purge -X http://example.com/page/
Stats & Reporting
Show cache stats [default]
usutil --stats -S
View Server Stats
Run the following command to view information about your server since it was last restarted.
Troubleshooting With –info
Run the following command to run a list of requests to help check the status of your cache.
usutil --info -I https://example.com
The above command will perform the following checks
- Make a request to the target URL and check the response status
- Calculates the total request time
- Checks the
X-Proxy-Cache
header - Checks for a matching cache object in the user’s cache zone. If it exists, checks the cache expiration time and validity
- Compares the target URI against the domain’s ngxconf config, then displays any matching rules
- Determines if a page is considered ‘static content’, and whether it was served from NGINX or Apache
- Displays
Location
redirects - Checks compression and content encoding
- Checks for presence of the
Vary
header - Checks for presence of any cookies, then displays them
- Displays which cache control headers are being trusted, according to the domain’s ngxconf config
- Checks for the presence of the
Upgrade
header - Checks if Apache
mod_http2
is installed and in use with NGINX - Checks the status of Apache, NGINX, and the associated PHP-FPM master
- Parses and displays corresponding lines from the Apache, NGINX, and PHP-FPM error logs
Congratulations! Now you know how to select your caching profile and manage your cache settings using NGINX Helper, W3 Total Cache, and SSH.
Post navigation