WpW: Using Admin IP Commands with LSCache
Welcome to another installment of WordPress Wednesday!
Today’s topic is: Using Admin IP Commands with LSCache
Disclaimer: The information contained in this post is accurate for LSCWP v1.8 [release log]. If you are using a newer version of the plugin, some details may have changed. Please refer to our wiki for the latest!
What are Admin IP Commands?
There is a spot in the LSCache for WordPress plugin settings where you can specify any IP address(es) belonging to your blog’s administrators. Then, if you visit your WP site from one of those listed IPs, LSCache will allow you to execute certain admin commands right from the site’s front-end using a special query string.
These query strings are only executed when they come from a listed Admin IP. Otherwise, they are ignored.
Specifying Your Admin IP(s)
From the WordPress Dashboard, navigate to LiteSpeed Cache > Settings > Debug. Enter each Admin IP address, one per line, in the Admin IPs box. Once you save your changes, LSCache will allow visitors from any IP listed here to manage the cache from the browser’s URL bar.
Using Admin IP Commands with LSCache
Once your Admin IPs are specified, you may use the
?LSCWP_CTRL= query string from the browser in order to trigger one of several actions. Please note that this query string and its parameters are case-sensitive, so they must be in ALL CAPS as seen here. The following parameters are available:
NOCACHE – This is used to display the uncached version of a page. It does not purge the page from cache, or disable the cache for that page. It simply generates the dynamic version of the page as if it were not cached.
Why would you want to use this? Perhaps you are running a test, and would like to verify that the cached version of a page is up-to-date. In separate tabs, you can open
http://example.com/page/?LSCWP_CTRL=NOCACHE and compare the results.
PURGE – This is used to purge all cache tags associated with a page, with the lone exception of the blog ID tag. (You would effectively purge the entire site, if you were to purge the blog ID cache tag.)
A page can have several tags associated with it: the post id tag, category tags, tag tags, author tags, etc. Using the
PURGE parameter will purge the page, and any other pages that contain the same cache tags. So, for example, imagine a page that describes a cold brew coffee method. It has the following categories: tutorials, coffee. It has the following tag: cold brew. If you enter the following URL:
LSCache will purge the
making-cold-brew page, along with the
tutorials category, the
coffee category, and the
cold brew tag.
PURGESINGLE – This is used to purge the first cache tag associated with the page, presumably the post id tag. Using the above example, if we substituted
PURGE, LSCache would only purge the
making-cold-brew cache tag. The related categories and tags would remain in cache.
SHOWHEADERS – This is used to show all the cache headers associated with a page. This may be useful for debugging purposes.
And that’s it for this week! Isn’t it nice when a topic is short and sweet? Feel free to leave a comment if you would like clarification on anything we covered today!
Have some of your own ideas for future WordPress Wednesday topics? Leave us a comment!
Don’t forget to meet us back here next week for the next installment. In the meantime, here are a few other things you can do:
- Subscribe to the WordPress Wednesday RSS feed
- Download LiteSpeed Cache for WordPress plugin
- Learn more about the plugin on our website