Nexcess & WordPress Cache Settings: Excluding Pages & Data
Caching can be an excellent solution for improving your WordPress website performance. Having requested data cached means it can be served to the website visitors quickly while bypassing the process of dynamic content generation. This streamlined serving is even more helpful for data that is requested more frequently.
In this article, we will review the WordPress cache settings available to Nexcess users and learn how we can exclude certain data pages and data from being cached to ensure caching will not cause issues with your website functionality.
Do You Need Caching for a Website?
Yes, caching for a website improves the visitor overall experience considerably, given that page loading times are a primary pain point for the majority of visitors. Cached data is considered temporary storage of web page elements like images, videos, and text that will be faster to load if caching for your website has been enabled.
How Do You Disable Caching in WordPress?
Disabling caching in WordPress is done by modified the wp-config.php file in your WordPress folder, be taking these steps:
1. Find and edit the wp-config.php file for your site.
2. Locate this section in wp-config.php file:
3. Change value of true to false.
4. Save your changes.
Nexcess: WordPress Cache Settings & Solutions Overview
Nexcess users can leverage built-in caching solutions optimized for the Content Management System (CMS) in use. That includes both page and persistent object cache that can help improve website load time if applied correctly.
Nexcess provides full-page caching for managed WordPress and WooCommerce sites by having a fully-optimized solution based on the KeyDNS’s Cache Enabler plugin’s functionality, which is automatically enabled. In addition, we maintain an improved version of the plugin that we created to serve better the needs of our WordPress, WooCommerce, and StoreBuilder platform users. Page caching means static HTML files of cached pages are stored on the disk in a specific WordPress cache folder.
We are using Redis as a persistent object cache solution for WordPress that helps reuse cached objects without sending queries to the WordPress database. Although WordPress does provide object caching, it is non-persistent. Redis stores data persistently for the saved objects to be reused between page loads.
Redis object caching is enabled on our managed WordPress and WooCommerce solution by having the Redis Object Cache plugin installed and activated by default.
Our customers, however, can use other page caching solutions for WordPress like WP-Rocket, W3 Total Cache, WP Super Cache, and similar. So if there is another WordPress caching plugin is used, its functionality will be sufficient, and our built-in page caching solution will not be activated. But if you switch to Nexcess Page Cache, you can enable it from your WordPress dashboard.
Excluding Data From Being Cached: When & Why
Each WordPress caching solution provided by Nexcess is fully-optimized for WordPress and takes all aspects of the content management system into account, so you will rarely need to adjust any WordPress cache settings yourself. However, there are cases when you need to exclude certain pages and specific data from being cached. Let’s see why we would want to do that sometimes.
WordPress is used to build dynamic, database-driven websites, which means dynamic content can contribute to a considerable part of your site. Data needs to be retrieved from the database and merged with template files to generate a static HTML page that will be sent to the visitor. This process lies at the heart of the content rendering process.
However, all sites are unique, and it is not uncommon for caching to interrupt the correct work of a WordPress website, which needs an individual approach to adjusting WordPress cache settings. So excluding certain pages and data from being cached can help avoid any issues with the website functionality that may arise due to caching.
WordPress Cache Settings & Solutions Already Excluded from Caching
All modern caching solutions for WordPress are designed to work efficiently with websites where dynamic features use PHP to generate the output. There are specific rules in place that detect certain changes to know when to flush cache and data exclusions that are meant to work in most situations.
For example, when running an ecommerce site, dynamic pages such as the account area, shopping cart, and checkout are already excluded from being cached by most WordPress cache solutions. It is done as some plugins and widgets still employ PHP instead of having content updated dynamically using Ajax.
WordPress Cache Settings: Excluding Pages and Data
Certain pages and data can be easily excluded from being cached in the WordPress cache settings of the caching solutions used by Nexcess. Let’s dive into the process to understand how we can do it to avoid any issues that can potentially be caused by caching. First we will review configuring exclusions in the Nexcess Page Cache, WP Rocket, and Redis Object Cache.
Data to be Excluded: Finding the IDs
Before we dive into excluding data from being cached, we need to understand what we can exclude and how. Most WordPress caching plugins allow you to exclude the following data:
- Page by ID. You can find a specific page ID by opening it for editing from WordPress admin and checking the post ID shown in the browser’s address bar.
- A group of pages by URLs. You will need to specify the paths one by one or using regex.
- Query strings. Query string parameters will also need to be specified using regex.
- Cookies by ID or full name. You can find the IDs by opening the Application tab from the dev tools in your web browser and checking the Storage section.
- Specific object groups. You can exclude partilcur groups of objects from being cached by using a WordPressconstant.
Nexcess Page Cache
Nexcess Page Cache settings can be adjusted from Nexcess > Page Cache in the WordPress Admin area. You can adjust the cache behavior, including how long a page needs to be stored in cache and what events can trigger pages to be generated again rather than retrieved from the WordPress cache folder. For example, you can choose to create an additional cached version for mobile devices.
The Cache Exclusions menu allows you to exclude specific data by page ID, website paths, query string parameters, or cookies. Nexcess Page Cache already has some data excluded by default. The default caching configuration, including the exclusions specified by default, will be sufficient for the correct work of a WordPress website in most cases.
Here we have excluded two pages by their IDs. You will need to use regex to add exclusions for everything else, including cookies and query string parameters.
WP Rocket Caching Plugin
WP Rocket plugin allows you to exclude cookies, pages, and groups of pages by IDs and URLs.
You can configure the exclusions from the Advanced Rules settings tab of the plugin’s interface.
Cache Query Strings
Although the WP Rocket plugin does not cache pages with query strings by default, there are a few exceptions. There is a group of ignored query string parameters that WP Rocket has by default.
You can customize query string caching by removing some of the ignored parameters from the list to prevent pages from being cached. You can also configure some pages with query strings to be cached by WP Rocket by adding specific parameters to the list under Cache Query String(s) in the Advanced Rules settings tab.
You can exclude pages and groups of pages by URL by listing them one by one or using regex to specify a rule.
Never Cache URLs
Never Cache Cookies
The Never Cache Cookies option allows you to exclude certain cookies by ID or name.
Redis Object Cache
Redis object cache allows WordPress users to exclude certain groups from being cached, which would cause the keys of the ignored groups never to be stored in Redis. It can be done by using the WP_REDIS_IGNORED_GROUPS WordPress constant in the wp-config.php file.
define( 'WP_REDIS_IGNORED_GROUPS', [ 'options', 'user_meta' ]);
There can be cases when the Redis cache could interrupt the correct work of a plugin. In that case, you can contact the plugin support or review the documentation to find the specific object groups the plugin uses to exclude them from being cached. But that might not be the correct approach, so it is crucial to have a professional look at the issue to determine what caused it.
Most of the time, manipulating object cache performance on a particular site requires the involvement of a strong WordPress developer familiar with your WordPress site structure.
How Do You Disable Caching in WordPress?
You can disable caching on your WordPress site by changing the value of the WP_CACHE constant in the wp-config.php file or by making changes to the caching plugins’ configuration.
Find and open the wp-config.php file for editing. You can do it by connecting via SSH or using the file manager interface. Locate the WP_CACHE constant in the wp-config.php file and change the value of it from true to false. Save the file to have WordPress caching disabled.
define('WP_CACHE',true); > define('WP_CACHE', false);
Generally, if you set the value of the WP_CACHE constant to false, most caching drop-ins will not be loaded. You may still need to rename or remove the advanced-cache.php and object-cache.php files in the wp-content directory.
You can also disable caching on your site from the WordPress Dashboard from your caching plugins’ configuration menus. This is an easier way that does not require you to change any files on the server manually. Moreover, caching will not be re-enabled automatically unless you revert the changes you made from the plugins' configuration.
Open your WordPress Dashboard and then navigate to Settings > Redis to disable the Redis Object Cache. You can disable Nexcess Page Cache or any other page caching solution by setting cache status to off in the plugin settings.
Caching can be a valuable option for speeding up your WordPress site, however, it will not be effective in all situations. Sometimes WordPress cache settings need to be adjusted to meet the specific needs of your website. Modern WordPress cache solutions allow you to customize their behavior, including having certain pages and data excluded from being cached.
Most of the time, the default configuration meets the requirements of most WordPress sites as it is specifically optimized for the content management system. However, there can be cases when certain areas of your website can work incorrectly due to caching. In that case, excluding data from being cached can be reasonable unless there is another solution.
Before you configure exclusions in a caching solution of any type, we strongly recommend you consult with a qualified WordPress developer.
Consider Managed Hosting with Nexcess
Nexcess provides managed hosting plans that are prepackaged with the best solutions for the chosen content management system. Built-in caching and a CDN combined with an enterprise-level application stack ensure the best website performance and security. Nexcess will take care of all the technical aspects of hosting while you are building your online presence. Check out our Nexcess Managed Hosting Plans to start today.
Scale Your WordPress/WooCommerce Solution with Nexcess
Managed WordPress and WooCommerce plans are scalable hosting plans that allocate 10 or more PHP workers per site. For static blogs or similar sites, that should be more than enough to have them work flawlessly, while other, more complicated websites will easily find their home within other Managed WordPress Hosting and Managed WooCommerce Hosting plans. These hosting plans also come with an excellent 24/7/365 support team ready to help with any glitches that might arise along the way!
See what industry insiders have to say about Nexcess and its use of PHP workers:
- 4 Best WordPress Hosting With Their “PHP Workers” Numbers
- Nexcess Honest Review 2022 | Is It A Good Option?
Other Useful WordPress Links for Developers & Admins
Further Reading for Performance Tuning WordPress
In addition to the increase in site performance by regular WordPress maintenance of WordPress transients, you can see an increase in site performance by:
Managed Hosting with Nexcess
Build Better Sites and Stores With Fully Managed Hosting from Nexcess
Faster Speeds, Stronger Security, Inherent Scalability and Trusted Support.
Our range of hosting plans caters to any business scale. We do all the heavy lifting for you to focus on growing your business. In addition, we automatically update ore components and plugins to the latest version and ensure your hosting environment is properly optimized, secured, and updated.
Nexcess infrastructure was specially designed to keep up the best speed and performance in the industry. No traffic surge can threaten your website to go down thanks to our autoscaling technology which adds more resources to your server to handle the load. In addition, we offer always-on security monitoring and support from web hosting experts 24/7/365 and a built-in CDN with 22 locations and advanced caching for ultra-fast loading.
All hosting plans include The Nexcess 30-Day Web Hosting Money Back Guarantee.
Need a No-Code Website Building Solution?
Are you on an accelerated schedule and already ready to move forward? If you need to get started with your Nexcess StoreBuilder Solution sooner rather than later, check out these resources:
Next Steps with a Nexcess Cloud Hosting Solution?
Read more about the Fully Managed Cloud Environment by Nexcess and its benefits for your business.
A Cloud Hosting Solution That Lets You Do Business Your Way
We believe in the promise of cloud: scalability, security, performance, and ease of use. Together with our team, clients, and partners, we’ve built something better.
Choose From Multiple Applications
Whether you’re a small business or a high-traffic eCommerce store, our cloud hosting solutions are designed around your needs: auto scaling, PCI compliance, and comprehensive development tools provide you with maximum dynamic flexibility in a fully managed cloud environment.
We make applications easy with environment optimizations for:
And there are many more!
We also have a variety of Nexcess support articles about how best to implement our product offerings housed in the Nexcess Knowledge Base, including how to get your site going with a number of different configuration options. These resources include a great article on setting this up for Migrating to Nexcess with managed WordPress and managed WooCommerce hosting.
About the Nexcess Portal
How to Become a Nexcess Portal Pro
You signed up for an account with Nexcess but now what do you do? New systems can be intimidating to learn, so we’ve put together this guide to help explain what is in the portal and where to find it.
Next Steps with Fully Managed WordPress Hosting?
Read more about the Fully Managed WordPress Hosting and its benefits for your business.
Build Better Websites with Fully Managed WordPress Hosting
It’s hosting optimized for WordPress. That means a faster, more secure and scalable website. Smart monitoring tools are built-in to help you keep it that way.
It’s why WordPress Users Trust Nexcess Hosting.
We also have a variety of Nexcess support articles about WordPress, including how to get your site going with a number of different configuration options. These resources include a great article on setting this up for Migrating to Nexcess with managed WordPress and managed WooCommerce hosting.
Considering Use of a CDN?
Many businesspeople wonder how a CDN speeds up your ecommerce site, but they will discover that the reasons are remarkably straightforward. Review the content, resources, and links in this article to learn more about those reasons in full detail.
If you need any assistance with the above-mentioned, don't hesitate to reach out. For 24-hour assistance any day of the year, Nexcess customers can contact our support team by email (firstname.lastname@example.org) or through your Client Portal.
Useful YouTube > Nexcess Channel Links
- Nexcess on YouTube - Home
- Nexcess on YouTube - Welcome to Your Nexcess Portal
- Nexcess on YouTube - Featured Videos
- Nexcess on YouTube - All Videos
- Nexcess on YouTube - All Playlists
Resources for More Information
Need more help? The Applications, WooCommerce, and WordPress sections within the Nexcess Knowledge Base are important resources for those seeking additional knowledge. Or, check out our related articles below.
The Applications section also contains valuable insights for those seeking additional knowledge about our other various hosted applications and platforms. Check out our related video playlists and articles below:
- Managed WordPress by Nexcess - Video Playlist
- Managed WooCommerce by Nexcess - Video Playlist
- Managed Magento by Nexcess - Video Playlist
New Customers: Fully Managed Hosting Solutions
- Scope of Support
- Getting started with managed WordPress and WooCommerce hosting
- Migrating to Nexcess with managed WordPress and managed WooCommerce hosting
- Going live with your site in Managed WordPress and Managed WooCommerce hosting
- WordPress Cleanup 101: 9 Easy Ways To Clean Up and Optimize Your WordPress Site
- How to configure the Nexcess CDN with WordPress and CDN Enabler
- The Nexcess Plugin Performance Monitor
- What is Scalable WordPress hosting?
- Everything You Wanted to Know About Auto Scaling
- Viewing AWStats for Managed WordPress & WooCommerce