Is WP-Optimize compatible with others cache plugins like WP Super Cache or W3 Total Cache?

Yes. You cannot use two page caches at the same time, and should not try. However, the WP-O page cache will only be switched on if you choose to turn it on; otherwise, it will have no effect on the site (either cacheing or performance). It is not turned on by default. Thus, WP-O can happily co-exist with other plugins.

(N.B. Also, because of how page cacheing works in WordPress, it is not possible to have more than one turned on at the same time; they might both think they’re turned on, but in effect, only the most recently turned-on will be doing anything).

When does WP-Optimize clear the page cache?

Full cache purge:

  • When changing/updating current themes and parent themes (of child themes)
  • When changing/updating current plugins
  • When turning off the cache feature in WP-Optimize
  • When editing widgets
  • When saving the customizer settings
  • When updating a menu
  • When Autoptimize purges its cache
  • When updating permalink structure
  • When changing cache settings
  • When updating string translations in WPML plugin
  • When updating the ‘posts_per_page’ option
  • When purging Avada theme’s fusion caches
  • When saving any of GetWooPlugins’ settings (Premium)

This can be changed by hooking into the filter wpo_purge_cache_hooks. E.g.

// Add a new action that will trigger a cache purge
add_filter( 'wpo_purge_cache_hooks', function( $actions ) {
    $actions[] = 'my_custom_action';
    return $actions;
} );

Partial cache purge:

  • When you publish new content or update/edit existing content, the cache for that post/page will be cleared, as well as associated content (category archives, blog archives)
  • When comments are approved, or their status changes
  • When terms are created or updated
  • When changing/updating stock quantity of WooCommerce product or product variation
  • When updating the ‘page_on_front’ option
  • When updating ‘page_for_posts’ option
  • When updating the ‘URLs to exclude from caching’ WP-Optimize caching configuration
  • When trashing a post
  • When running importers
  • When WooCommerce product is on sale (Premium)

 

How do I generate separate cache files based on a cookie key?

You can use the `wpo_cache_cookies` filter to generate separate cache files. For example, you may want to generate separate cache files for different currencies. You can modify and use the following code snippet to do so:

<?php
add_filter('wpo_cache_cookies', 'myprefix_add_cache_cookies', 20, 2);

function myprefix_add_cache_cookies($cookies) {
if (// Check if some feature exists that needs separate cache) {
$cookie[] = 'cache_key_that_needs_separate_cache';
}
return $cookies;
}

What is cache lifespan?

WordPress uses nonces as security tokens which are printed in the source code of the page. These nonces cannot be reused and are valid for 12 hours by default, but developers can change that value. The nonce getting invalidated can affect all kinds of functionality on the site like form validation or the visual appearance of a page among others.

Setting a cache lifespan to under 10 hours ensures the cache is flushed automatically once the nonce expires. This way you can use WPO cache on sites which use nonces.

The cache lifespan option is set to 10 hours by default, but you may have go down to 8 or even less. A lower cache lifespan value will result in more frequent cache update activity on your server, and thus more preload processes, if activated. If you notice any issues due to high server load, set a higher interval for the preloader.

User specific cache

User specific cache is specifically built for your membership site, or any type of site where pages contain user specific content.

Enabling “User specific cache” will create a cache version for each logged-in user, resulting in great performance for your website members.

Note that if you have many users, this could result in a large amount of files.

The website will also be cached for non logged-in users.

Note that the cache preloader will only preload the cache for non logged-in users.

NB: User specific cache is a premium feature