Author: WP Sharks Author URI: https://cometcache.com Contributors: WebSharks, JasWSInc, raamdev, clavaque Donate link: https://cometcache.
If you care about the speed of your site, Comet Cache is one of those plugins that you absolutely MUST have installed 🙂 Comet Cache takes a real-time snapshot (building a cache) of every Page, Post, Category, Link, etc. These snapshots are then stored (cached) intuitively, so they can be referenced later, in order to save all of that processing time that has been dragging your site down and costing you money.
The Comet Cache plugin uses configuration options that you select from the options panel. See: Comet Cache -› Options in your Dashboard. Once a file has been cached, Comet Cache uses advanced techniques that allow it to recognize when it should and should not serve a cached version of the file. By default, Comet Cache does not serve cached pages to users who are logged in, or to users who have left comments recently. Comet Cache also excludes administrative pages, login pages, POST/PUT/DELETE/GET(w/ query string) requests and/or CLI processes.
TIP: you can preview Pro features in the free version by clicking the “Preview Pro Features” link at the top of your Comet Cache options.
To understand how Comet Cache works, first you have to understand what a cached file is, and why it is absolutely necessary for your site and every visitor that comes to it. WordPress® (by its very definition) is a database-driven publishing platform. That means you have all these great tools on the back-end of your site to work with, but it also means that every time a Post/Page/Category is accessed on your site, dozens of connections to the database have to be made, and literally thousands of PHP routines run in harmony behind-the-scenes to make everything jive. The problem is, for every request that a browser sends to your site, all of these routines and connections have to be made (yes, every single time). Geesh, what a waste of processing power, memory, and other system resources. After all, most of the content on your site remains the same for at least a few minutes at a time. If you’ve been using WordPress® for very long, you’ve probably noticed that (on average) your site does not load up as fast as other sites on the web. Now you know why!
In computer science, a cache (pronounced /kash/) is a collection of data duplicating original values stored elsewhere or computed earlier, where the original data is expensive to fetch (owing to longer access time) or to compute, compared to the cost of reading the cache. In other words, a cache is a temporary storage area where frequently accessed data can be stored for rapid access. Once the data is stored in the cache, it can be used in the future by accessing the cached copy rather than re-fetching or recomputing the original data.
Comet Cache is extremely reliable, because it runs completely in PHP code, and does not hand important decisions off to the mod_rewrite
engine or browser cache; also making Comet Cache MUCH easier to setup and configure.
In addition, Comet Cache actually sends a no-cache header (yes, a no-cache header); which allows it to remain in control at all times. It might seem weird that a caching plugin would send a no-cache header :-). Well, no-cache headers are a key component in this plugin, and they will NOT affect performance negatively. On the contrary, this is how the system can accurately serve cache files to public users vs. users who are logged-in, commenters, etc.
If you care about the speed of your site, Comet Cache is one of those plugins that you absolutely MUST have installed 🙂 Comet Cache takes a real-time snapshot (building a cache) of every Page, Post, Category, Link, etc. These snapshots are then stored (cached) intuitively, so they can be referenced later, in order to save all of that processing time that has been dragging your site down and costing you money.
The Comet Cache plugin uses configuration options that you select from the options panel. See: Comet Cache -› Options in your Dashboard. Once a file has been cached, Comet Cache uses advanced techniques that allow it to recognize when it should and should not serve a cached version of the file. By default, Comet Cache does not serve cached pages to users who are logged in, or to users who have left comments recently. Comet Cache also excludes administrative pages, login pages, POST/PUT/DELETE/GET(w/ query string) requests and/or CLI processes.
WordPress® Multisite Networking is a special consideration in WordPress®. If Comet Cache is installed under a Multisite Network installation, it will be enabled for ALL blogs the same way. The centralized config options for Comet Cache, can only be modified by a Super Administrator operating on the main site. Comet Cache has internal processing routines that prevent configuration changes, including menu displays; for anyone other than a Super Administrator operating on the main site.
You don’t have to use an .htaccess
file to enjoy the performance enhancements provided by this plugin; caching is handled by WordPress®/PHP alone. That being said, if you want to take advantage of GZIP compression (and we do recommend this), then you WILL need an .htaccess
file to accomplish that part. This plugin fully supports GZIP compression on its output. However, it does not handle GZIP compression directly. We purposely left GZIP compression out of this plugin, because GZIP compression is something that should really be enabled at the Apache level or inside your php.ini
file. GZIP compression can be used for things like JavaScript and CSS files as well, so why bother turning it on for only WordPress-generated pages when you can enable GZIP at the server level and cover all the bases!
If you want to enable GZIP and your site is running on the Apache web server, visit Dashboard -> Comet Cache -> Apache Optimizations -> Enable GZIP Compression?; or to enable GZIP compression manually create an .htaccess
file in your WordPress® installation directory (or edit the one that’s already there) and put the following few lines in it. That is all there is to it. GZIP is now enabled!
<IfModule deflate_module> <IfModule filter_module> AddOutputFilterByType DEFLATE text/plain text/html AddOutputFilterByType DEFLATE text/xml application/xml application/xhtml+xml application/xml-dtd AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml image/svg+xml AddOutputFilterByType DEFLATE text/css text/javascript application/javascript application/x-javascript AddOutputFilterByType DEFLATE font/otf font/opentype application/font-otf application/x-font-otf AddOutputFilterByType DEFLATE font/ttf font/truetype application/font-ttf application/x-font-ttf </IfModule> </IfModule>
If your installation of Apache does not have mod_deflate
installed. You can also enable GZIP compression using PHP configuration alone. In your php.ini
file, you can simply add the following line anywhere: zlib.output_compression = on
Ordinarily you can just deactivate Comet Cache from the plugins menu in WordPress. However, if you’re having a more serious issue, please follow the instructions here.
/wp-content/advanced-cache.php
/wp-content/plugins/comet-cache/
/wp-config.php
file: define('WP_CACHE', TRUE);
Comet Cache is now completely uninstalled and you can start fresh 🙂
TIP: you can preview Pro features in the free version by clicking the “Preview Pro Features” link at the top of your Comet Cache options.
Comet Cache Pro is a wholly contained plugin that does not require Comet Cache Lite to be installed. To install Comet Cache Pro,
Once the plugin is active, you can go to Dashboard -> Comet Cache -> Plugin Options -> Enable/Disable and Enable Comet Cache.
Also, to stay updated with the latest version of Comet Cache Pro, be sure to also configure Dashboard -> Comet Cache -> Plugin Updater.
In addition to the WordPress Requirements, Comet Cache requires the following minimum versions:
Copyright: © 2016 WP Sharks (coded in the USA)
Released under the terms of the GNU General Public License.
Quick Tip: WordPress® can only deal with one cache plugin being activated at a time. Please uninstall any existing cache plugins that you’ve tried in the past. In other words, if you’ve installed W3 Total Cache, WP Super Cache, DB Cache Reloaded, or any other caching plugin, uninstall them all before installing Comet Cache. One way to check, is to make sure this file: wp-content/advanced-cache.php
and/or wp-content/object-cache.php
are NOT present; and if they are, delete these files BEFORE installing Comet Cache. Those files will only be present if you have a caching plugin already installed. If you don’t see them, you’re ready to install Comet Cache :-).
A note for existing ZenCache users: Comet Cache is the successor to ZenCache and will automatically detect any existing ZenCache options and migrate that options over to Comet Cache. For further details, please see the migration FAQ.
/comet-cache
folder to your /wp-content/plugins/
directory.First of all, make sure that you’ve enabled Comet Cache. After you activate the plugin in WordPress, go to the Comet Cache options panel and enable caching (you can’t miss the big yellow checkbox). Then scroll to the bottom and click Save All Changes. All of the other options on that page are already pre-configured for typical usage. Skip them all for now. You can go back through all of these later and fine-tune things the way you like them.
Once Comet Cache has been enabled, you’ll need to log out (and/or clear browser cookies). Cache files are NOT served to visitors who are logged in, and that includes you too 🙂 Cache files are NOT served to recent commenters either. If you’ve commented (or replied to a comment lately); please clear your browser cookies before testing.
To verify that Comet Cache is working, navigate your site like a normal visitor would. Right-click on any page (choose View Source), then scroll to the very bottom of the document. At the bottom, you’ll find comments that show Comet Cache stats and information. You should also notice that page-to-page navigation is lightning fast compared to what you experienced prior to installing Comet Cache.
WordPress® Multisite Networking is a special consideration in WordPress®. If Comet Cache is installed under a Multisite Network installation, it will be enabled for ALL blogs the same way. The centralized config options for Comet Cache, can only be modified by a Super Administrator operating on the main site. Comet Cache has internal processing routines that prevent configuration changes, including menu displays; for anyone other than a Super Administrator operating on the main site.
Ordinarily you can just deactivate Comet Cache from the plugins menu in WordPress. However, if you’re having a more serious issue, please follow the instructions here.
/wp-content/advanced-cache.php
/wp-content/plugins/comet-cache/
/wp-config.php
file: define('WP_CACHE', TRUE);
Comet Cache is now completely uninstalled and you can start fresh 🙂
Step 1: Enable Comet Cache
Step 2: Save All Changes; that's it!
One-click Clear Cache button
Plugin Deletion Safeguards
Intelligent and automatic cache clearing
Cache Directory
Cache Expiration Time
Client-Side Cache
GET Requests
404 Requests
RSS, RDF, and Atom Feeds
URI Exclusion Patterns
HTTP Referrer Exclusion Patterns
User-Agent Exclusion Patterns
Apache Optimizations
Theme/Plugin Developers
Comet Cache is the successor to ZenCache and will automatically detect any existing ZenCache options and migrate those options over to Comet Cache. For further details, please see the migration FAQ.
First of all, make sure that you’ve enabled Comet Cache. After you activate the plugin, go to the Comet Cache options panel and enable it, then scroll to the bottom and click Save All Changes. All of the other options on that page are already pre-configured for typical usage. Skip them all for now. You can go back through all of them later and fine-tune things the way you like them.
Once Comet Cache has been enabled, you’ll need to log out (and/or clear browser cookies). Cache files are NOT served to visitors who are logged in, and that includes you too 🙂 Cache files are NOT served to recent commenters either. If you’ve commented (or replied to a comment lately); please clear your browser cookies before testing.
To verify that Comet Cache is working, navigate your site like a normal visitor would. Right-click on any page (choose View Source), then scroll to the very bottom of the document. At the bottom, you’ll find comments that show Comet Cache stats and information. You should also notice that page-to-page navigation is lightning fast compared to what you experienced prior to installing Comet Cache.
There is NOT one! Comet Cache is a MUST HAVE for every WordPress® powered site. In fact, we really can’t think of any site running WordPress® that would want to be without it. To put it another way, the WordPress® software itself comes with a built in action reference for an advanced-cache.php
file, because WordPress® developers realize the importance of such as plugin. The /wp-content/advanced-cache.php
file is named as such, because the WordPress® developers expect it to be there when caching is enabled by a plugin. If you don’t have the /wp-content/advanced-cache.php
file yet, it is because you have not enabled Comet Cache from the options panel yet.
To understand how Comet Cache works, first you have to understand what a cached file is, and why it is absolutely necessary for your site and every visitor that comes to it. WordPress® (by its very definition) is a database-driven publishing platform. That means you have all these great tools on the back-end of your site to work with, but it also means that every time a Post/Page/Category is accessed on your site, dozens of connections to the database have to be made, and literally thousands of PHP routines run in harmony behind-the-scenes to make everything jive. The problem is, for every request that a browser sends to your site, all of these routines and connections have to be made (yes, every single time). Geesh, what a waste of processing power, memory, and other system resources. After all, most of the content on your site remains the same for at least a few minutes at a time. If you’ve been using WordPress® for very long, you’ve probably noticed that (on average) your site does not load up as fast as other sites on the web. Now you know why!
In computer science, a cache (pronounced /kash/) is a collection of data duplicating original values stored elsewhere or computed earlier, where the original data is expensive to fetch (owing to longer access time) or to compute, compared to the cost of reading the cache. In other words, a cache is a temporary storage area where frequently accessed data can be stored for rapid access. Once the data is stored in the cache, it can be used in the future by accessing the cached copy rather than re-fetching or recomputing the original data.
The cache files are stored in a special directory: /wp-content/cache/comet-cache
. This directory needs to remain writable, just like the /wp-content/uploads
directory on many WordPress® installations. The /comet-cache/cache
directory is where cache files reside. These files are stored using an intutive directory structure that named based on the request URL (HTTPS/HTTP_HOST/REQUEST_URI
). See also: Dashboard -› Comet Cache -› Cache Directory/Expiration Time for further details.
Whenever a request comes in from someone on the web, Comet Cache checks to see if it can serve a cached file; e.g. it looks at the HTTPS/HTTP_HOST/REQUEST_URI
environent variables, then it checks the /comet-cache/cache
directory. If a cache file has been built already, and it matches an existing HTTPS.HTTP_HOST.REQUEST_URI
combination; and it is not too old (see: Dashboard -› Comet Cache -› Cache Directory/Expiration Time), then it will serve that file instead of asking WordPress® to regenerate it. This adds tremendous speed to your site and reduces server load.
By default, Comet Cache does NOT serve cached pages to users who are logged in, or to users who have left comments recently. Comet Cache also excludes administrative pages, login pages, POST/PUT/DELETE/GET(w/ query string) requests and/or CLI processes. That being said, the Pro version of Comet Cache DOES make it possible to cache pages even when users ARE logged-in; adding even more speed! This is particularly helpful on membership sites; e.g. sites that run plugins like s2Memberâ„¢ for instance.
It depends on your configuration of Comet Cache. There is an automatic expiration system (the garbage collector), which runs through WordPress® behind-the-scene, according to your Expiration setting (see: Dashboard -› Comet Cache -› Cache Directory/Expiration Time). There is also a built-in expiration time on existing files that is checked before any cache file is served up, which also uses your Expiration setting. In addition; whenever you update a Post or a Page, Comet Cache can automatically prune that particular file from the cache so it instantly becomes fresh again. Otherwise, your visitors would need to wait for the previous cached version to expire.
By default, Comet Cache does NOT serve cached pages to users who are logged in, or to users who have left comments recently. Comet Cache also excludes administrative pages, login pages, POST/PUT/DELETE/GET(w/ query string) requests and/or CLI processes.
There is no need to use an .htaccess
file with this plugin; caching is handled by WordPress®/PHP alone. That being said, if you also want to take advantage of GZIP compression (and we do recommend this), then you WILL need an .htaccess
file to accomplish that part. This plugin fully supports GZIP compression on its output. However, it does not handle GZIP compression directly. We purposely left GZIP compression out of this plugin, because GZIP compression is something that should really be enabled at the Apache level or inside your php.ini
file. GZIP compression can be used for things like JavaScript and CSS files as well, so why bother turning it on for only WordPress-generated pages when you can enable GZIP at the server level and cover all the bases!
If you want to enable GZIP and your site is running on the Apache web server, visit Dashboard -> Comet Cache -> Apache Optimizations -> Enable GZIP Compression?; or to enable GZIP compression manually create an .htaccess
file in your WordPress® installation directory (or edit the one that’s already there) and put the following few lines in it. That is all there is to it. GZIP is now enabled!
<IfModule deflate_module> <IfModule filter_module> AddOutputFilterByType DEFLATE text/plain text/html AddOutputFilterByType DEFLATE text/xml application/xml application/xhtml+xml application/xml-dtd AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml image/svg+xml AddOutputFilterByType DEFLATE text/css text/javascript application/javascript application/x-javascript AddOutputFilterByType DEFLATE font/otf font/opentype application/font-otf application/x-font-otf AddOutputFilterByType DEFLATE font/ttf font/truetype application/font-ttf application/x-font-ttf </IfModule> </IfModule>
If your installation of Apache does not have mod_deflate
installed. You can also enable gzip compression using PHP configuration alone. In your php.ini
file, you can simply add the following line anywhere: zlib.output_compression = on
<?php
define(‘COMET_CACHE_ALLOWED’, FALSE); // The easiest way.
// or $_SERVER[‘COMET_CACHE_ALLOWED’] = FALSE; // Also very easy.
// or define(‘DONOTCACHEPAGE’, TRUE); // For compatibility with other cache plugins.
When your script finishes execution, Comet Cache will know that it should NOT cache that particular page. It does not matter where or when you define this Constant; e.g. define('COMET_CACHE_ALLOWED', FALSE);
because Comet Cache is the last thing to run during execution. So as long as you define this Constant at some point in your routines, everything will be fine.
Comet Cache also provides support for define('DONOTCACHEPAGE', TRUE)
, which is used by the WP Super Cache plugin as well. Another option is: $_SERVER['COMET_CACHE_ALLOWED'] = FALSE
. The $_SERVER
array method is useful if you need to disable caching at the Apache level using mod_rewrite
. The $_SERVER
array is filled with all environment variables, so if you use mod_rewrite
to set the COMET_CACHE_ALLOWED
environment variable, that will end up in $_SERVER['COMET_CACHE_ALLOWED']
. All of these methods have the same end result, so it’s up to you which one you’d like to use.
If you don’t update your site much, you could set this to 6 months
; optimizing everything even further. The longer the cache expiration time is, the greater your performance gain. Alternatively, the shorter the expiration time, the fresher everything will remain on your site. A default value of 7 days
(recommended expiration time), is a good conservative middle-ground.
Keep in mind that your expiration setting is only one part of the big picture. Comet Cache will also purge the cache automatically as changes are made to the site (i.e. you edit a post, someone comments on a post, you change your theme, you add a new navigation menu item, etc., etc.). Thus, your expiration time is really just a fallback; e.g. the maximum amount of time that a cache file could ever possibly live.
That being said, you could set this to just 60 seconds
and you would still see huge differences in speed and performance. If you’re just starting out with Comet Cache (perhaps a bit nervous about old cache files being served to your visitors); you could set this to something like 30 minutes
and experiment with it while you build confidence in Comet Cache. It’s not necessary, but many site owners have reported this makes them feel like they’re more-in-control when the cache has a short expiration time. All-in-all, it’s a matter of preference 🙂
Ordinarily you can just deactivate Comet Cache from the plugins menu in WordPress. However, if you’re having a more serious issue, please follow the instructions here.
/wp-content/advanced-cache.php
/wp-content/plugins/comet-cache/
/wp-config.php
file: define('WP_CACHE', TRUE);
Comet Cache is now completely uninstalled and you can start fresh 🙂
white-space:nowrap
in Firefox. See Issue #866.basename(__FILE__)
from direct access notices.Note: This is a Comet Cache Pro maintenance release.
admin-bar.min.css
was missing, which caused issues with the Admin Bar buttons. This was due to a glitch in our build system. See Issue #864.Note: This is a Comet Cache Pro maintenance release.
Unable to determine UA info directory location
when upgrading to latest release. See Issue #862.opcache.restrict_api
. Comet Cache is now smart enough to avoid generating the PHP Warning: PHP Warning: Zend OPcache API is restricted by “restrict_api” configuration directive. See Issue #733./u
flag to all preg_*()
calls in cache clearing routines that generate cache paths from Watered-Down Regex patterns entered by a site owner. See: Issue #611.srcset
. This release enhances Static CDN Filters in Comet Cache Pro. Static CDN Filters are now smart enough to filter all image sources included in an srcset=""
attribute that is generated by WordPress. See Issue #660. If you’d like to learn more about srcset=""
, see this article at WordPress.org./amp/
, or the document contains a top-level <html âš¡>
tag (<html amp>
is accepted as well), then features which are incompatible with Accelerated Mobile Pages will be disabled accordingly.wp_get_sites()
and use get_sites()
instead. See Issue #848.^
and $
in some places where these special characters are not fully supported. Also adding the same notes to the Watered-Down Regex KB Article. See also: Issue #611.autocomplete="off"
to all form tags in Comet Cache menu pages. See Issue #832..htaccess
in some scenarios. Fixed in this release. See Issue #798.Chart.js
unnecessarily in lite version of the software. See Issue #830.woocommerce_product_set_stock_status
hook in addition to the woocommerce_product_set_stock
hook. See Issue #674.utm_*
variable names) without incurring a cache performance hit. See Issue #639.<style id='rs-plugin-settings-inline-css'
. See Issue #614.clearstatcache()
and uses file_exists()
instead of is_dir()
to help make this check more robust. See Issue #786.mbstring
extension was missing. Props @jaswsinc for finding the bug. See Issue #817.options-general.php
URL. As a result, the entire cache was being unnecessarily cleared when the settings for those other plugins were saved. Props to @futtta from Autoptimize for reporting. See Issue #825.WP_CACHE
line that gets inserted into the wp-config.php
file to enable caching now follows the WordPress PHP Code Standards. Props @szepeviktor. See Issue #799..htaccess
file the appropriate configuration based on the options you enable or disable (all options are disabled by default, so your .htaccess
file is not modified unless you say so). If you prefer to update your .htaccess
file manually, the necessary configuration can be viewed beneath each option. Props @jaswsinc, @renzms. See Issue #789..htaccess
file to enable GZIP compression. This option is disabled by default. The old “GZIP Compression” panel has been removed in favor of the new option inside Apache Optimizations. Props @renzms, @jaswsinc. See Issue #764..htaccess
file to enable Browser Caching. This option is disabled by default. Props @renzms, @jaswsinc. See Issue #764..htaccess
code to enforce the correct canonical URLs according to your WordPress Permalink settings (Comet Cache detects if the Permalink Structure ends with a trailing slash, or without a trailing slash). Props @renzms, @jaswsinc. See Issue #554._cron_comet_cache_cleanup
) would never run, or the Next Run time would constantly reset to 1 minute away from running every time a page was reloaded. We suspect this is a race condition and in attempt to work around this issue we now skip all of our Cron-related checks if Cron is currently in the middle of running a process. Props @xberg and @lkraav for help reporting. See Issue #653.redirect_canonical()
function never gets run. This was fixed by adding an option to the new Apache Optimizations panel that allows you to Enforce Canonical URLs. Props @renzms, @jaswsinc. See Issue #554..htaccess
file that are designed to prevent issues with CORS. See Apache Optimizations Send Access-Control-Allow-Origin Header? See Issue #787.allow_fopen_url=0
, the Auto-Cache Engine will use the fallback to download the XML Sitemap and parse it from a temporary file. If you want to force the use of this fallback even when allow_fopen_url=1
, you can use a filter. See Issue #440.COMET_CACHE_ALLOW_BROWSER_CACHE
constant to COMET_CACHE_ALLOW_CLIENT_SIDE_CACHE
. Backwards compatibility has been maintained.allow_browser_cache
plugin option to allow_client_side_cache
.For older changelog history going back more than 7 years, please see CHANGELOG.md.