11

To flush a single page by post id in w3tc v0.9.3 I found this worked: if (function_exists('w3tc_pgcache_flush_post')){ w3tc_pgcache_flush_post($post_id); }


10

You need to either Version your files (by calling it style.css?ver=xxx.xxx) and making sure your CloudFront distribution has "Forward Query strings" turned on. This is the better option, as it means that all you need to do is increment the number in the query string and CloudFront will fetch this file automatically. Manually invalidate your files via the ...


10

Your site has likely been hacked. My site had the Darkleech infection, which injected some malicious code into wp-includes/nav-menu.php, causing .htaccess to reset to 444 on any page load. I'd recommend you install the Sucuri plugin and let it restore any files that have been corrupted. Assuming your site was hacked, use their Post-Hack tab to reset plugins,...


8

There's a pretty simply "trick" to prevent caching, when file contents changed: Add a version number, that is set to the latest date/time you changed your file. add_action( 'wp_enqueue_scripts', 'wpse61738_non_cached_stylesheet' ); function wpse61738_non_cached_stylesheet() { wp_enqueue_style( 'style-main', get_stylesheet_directory_uri()...


7

Let’s start with the output we got before the fix: What happened here? My guess: a collision between the plugin W3 Total Cache and your web server LiteSpeed. I found a thread in a Drupal forum about a very similar (or the same) issue. LiteSpeed seems not to send the appropriate HTTP headers for the compressed cache files W3TC stores. In its changelog for ...


6

W3TC is a framework. The intent is to optimize the origin (the stack the WordPress application runs on) and THEN what runs "on top" of it. A great discussion around that is available here: http://websynthesis.com/wsa/wp-content/uploads/2013/09/The-Truth-About-WordPress-Performance.pdf?utm_content=buffere8e5b&utm_source=buffer&utm_medium=twitter&...


5

W3 Total Cache has 4 locations to include the minified files. Since wp_localize_script() hooks into wp_head() (unless you specify in footer in your enqueue) you can use the before </body> minify location and your script will have access to the variables set. On some occasions this has failed for me so I just exclude the script from minify.


5

None of the above worked for me in my plugin. However this worked! Confirmed working for version 0.9.2.4 of w3tc. if (function_exists('w3tc_dbcache_flush')) { w3tc_dbcache_flush(); } I did a " $wpdb->get_results( "SELECT sb_settings.f_fb_app_id,sb_settings.f_fb_secret FROM sb_settings" ); " and was surprised the values f_fb_secret and f_fb_app_id was the ...


5

The W3 Total Cache plugin changes the URL of various files in /w3-total-cache/lib/W3/Plugin/Cdn.php in the function *ob_callback*. It uses a series of callbacks to modify an output buffer. The code runs like this: w3_total_cache.php calls $root->run(); W3_Root::run calls $plugin->run() for each plugin in $this->_loaded_plugins W3_Plugin_TotalCache::...


5

Since, your site already uses W3 Total Cache plugin, let me provide a solution based on it. Please visit yoursite's wp-admin/admin.php?page=w3tc_browsercache and look for the text "Set cache control header". Check this option, if it is unchecked, and then choose "no-cache" for the "Cache control policy". This needs to be done in three places... CSS & ...


4

This happened to me because I had two plugins trying to GZip compress the output. Disabling the second plugin fixed the problem.


4

The Transient API saves data inside the database, which isn't as effective as APC, but a similar workflow as used for transients can be used for APC. It is important to check if APC is available and active, so its functions are usable. Because this isn't always the case, it is to consider to add a alternative to APC via Transient API and combine those two ...


4

In W3TC you can specify files or cookies that are ignored and not cached. Exclude Files from Cache To do this go to WordPress Admin > Performance > Page Cache In the screenshot ... you will see I've added custom sidebars from a Twenty-Eleven theme. These are excluded from being cached. You can also specify your custom cookie to not be cached ... ...


4

Easiest way to do this was to define a constant programmatically: // Tell WP Super Cache & W3 Total Cache to not cache WPReadable requests define( 'DONOTCACHEPAGE', true );


4

W3 Total Cache is a GREAT option! One thing to keep in mind is that you need to individually work with each site for the settings - there is not a global settings area (yet). The next version is said to have this built-in. If you need this "right now", then WP Super cache does this and is a great option, if you can hold out for a little bit, then W3 Total ...


4

A simple solution could be to check when you click the "empty all cache" Button with $_GET Like this: function wpse_16722_purge_varnish() { // Is the button submitted, Get the value $purge = isset( $_GET['w3tc_note'] ) ? trim( $_GET['w3tc_note'] ) : ''; // Security-check, user can edit settings // And the button "Empty all cache" is ...


4

I recommend you to read this article W3 Total Cache -Plugin: The Complete Settings Guide, it's a great tutorial to manually setup your w3tc. And when you saving your settings remember to flush your cache because if you don't Google Pagespeed will test it on the old cached files.. You can try to add this .htaccess rules: ## EXPIRES CACHING ## <IfModule ...


4

You should use "Enhanced" if it's available. It serves cached pages using the server's URL rewriting capabilities, skipping PHP and WordPress entirely. It's faster and more efficient.


3

I find that W3 Total Cache works well for me in doing minifying and gzipping. (I'm not sure about the others.) More generally, if there's a plugin that does something, I use the plugin. It's very rare to see a do-it-all theme do something better than a specialized, single-function plugin, particularly when that plugin is of the caliber of W3 Total Cache.


3

We use it with great success with about 2 million page views of traffic monthly and it relieves a great deal of stress from our servers. As others have mentioned, its configurability is also a plus allowing you to control which sites use it or not. Our experience is using IIS so your mileage may vary if you're using Apache or ngix


3

In short yes ... I'm using it on my own multisite with about 7 subsites and its working fine. If you have many users, then this probably a good choice as it can be activated per blog. It also has a great deal of integration for CDN, minify and and control over the caching headers.


3

As @andreascreten, wp-cli will do the job for you. wp-cli includes commands for W3TC (located in the src/php/wp-cli/commands/community/total-cache.php file), so you can flush the cache by running: $ wp total-cache flush <type> Where <type> is one of 'db', 'minify', 'object', 'page' or 'post'. (Note: If you use 'post', you'll need to pass in --...


3

You can try to use remove_menu_page(), so you code example would be like: function hide_w3tc() { if (!current_user_can('manage_network')) { remove_menu_page('w3tc_dashboard'); } } add_action( 'admin_menu', 'hide_w3tc',11); where we use a priority greater than the default of 10, since the W3TC menu page is added via add_menu_page('...


3

Try using the following for your rewrite rules: location / { try_files $uri $uri/ /index.php$is_args$args; } Using that schema, you can manually remove index.php from your Permalinks settings without breaking anything. Nginx will now check any URI for its existence as a file on the filesystem, and then a directory on the filesystem, and if neither of ...


3

Transient API works in WordPress out of the box and does not require any plugin. However installing special object cache drop in can change it's back-end implementation. Typically for keeping data in memory rather than database and improving its performance. Like rainbows and unicorns. "against" is not clear in your question. No. Full page caching plugins (...


3

You seem to be a little confused about what function APCu performs. It only implements key/value store. It performs no opcode caching, since the whole point of APCu is to leave that to new Zend implementation of opcode. When you use APC(u) and compatible object cache plugin WP switches to storing its cache (which is natively discarded when page load ends) ...


3

At the time of this writing, W3TC only recognizes the php5-memcache (vs. php5-memcached) PHP client for memcached memory object caching system/software. Hence the "Memcache extension: Installed" in W3TC compatibility test for memcached. Memcached being useful and efficient as a caching method for database and/or object user/data caching via W3TC, even on a ...


3

This is a feature. You can try to disable caching for logged in users, but if it is in the main nav this still won't help as according to the settings screen: Don't cache pages for logged in users Unauthenticated users may view a cached version of the last authenticated user's view of a given page. Disabling this option is not recommended. There ...


3

WordPress has a number of implicit assumptions with regards to using SSL. Specifically, if you are using force_ssl_admin, and the "front" of your site has the same domain as the "back" does, then it assumes that your entire site is actually accessible either via http or https. This happens in a few different places. Most notably, the Theme Customizer ...


3

For WordPress Website optimization you should take a look at: https://codex.wordpress.org/WordPress_Optimization I took a look at your pagespeed report and the main thing there are the images you are using. There are many plugins that can optimize them for you. I like this one in particular: https://wordpress.org/plugins/imsanity/ As per the server cache, ...


Only top voted, non community-wiki answers of a minimum length are eligible