In this guide, we’ll go over the utilities that are available to help you manage your sites cached data. Managing the cached data for your site is important to ensure that visitors will see the correct content. This is useful after changes are made to the site, requiring purging of cached data to ensure the updated content is visible on the web. Below we discuss using the NGINX Helper plugin from the WordPress dashboard as well as commands to run over command line to manage cache.
Managing Cache with NGINX Helper
NOTE: NGINX Helper will automatically be installed on your site, so you just need to access and choose your purge settings.
- Log into your WordPress Admin 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
Managing Cache using Command Line
IMPORTANT: The following commands will require that SSH access has been established to the server associated with your account.
-
Purge All Cached Data
usutil --purgeall -Z -
Purge Cache for a Specific Page
usutil --purge -X http://example.com/page/REPLACE: http://example.com/page/ with the URL of the specific page you want to purge caching data for.
-
Show Cache Stats
usutil --stats -S -
Checking Cache Status and Troubleshooting
usutil --info -I https://example.comREPLACE: https://example.com with the URL of the specific site.
-
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-Cacheheader - 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
Locationredirects - Checks compression and content encoding
- Checks for presence of the
Varyheader - 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
Upgradeheader - Checks if Apache
mod_http2is 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
-
Comments
0 comments
Article is closed for comments.