Clear the Cache by Calling the Function Hook

Clear the Cache by Calling the Function Hook

by admin

You can clear the cache by calling the following functions. You can use them outside of the plugin.

You can clear all the cache with the following functions. The function takes only 1 parameter. The rebuild cache operation is successively called if you enabled the preload option.

// it clears all the cache
wpfc_clear_all_cache();

// it clears cache of all sites
wpfc_clear_all_site_cache();

// it clears all the cache with the minified sources
wpfc_clear_all_cache(true);

and You can delete the cache of a post, a page or a custom page by calling the function. The function takes only 1 parameter. You need to enter the id of the content. The cache of post’s tags, archive and category are cleared as well.

//it clears the post with ID 1923
wpfc_clear_post_cache_by_id(1923);

Note: If you are using WPML plugin, you need to disable the Make themes work multilingual option as below. Otherwise, it returns the default language url.

Related articles

How to Redirect All HTTP to HTTPS .htaccess
How to Redirect All HTTP to HTTPS .htaccess

If you have installed an SSL certificate on your website, the website may not be available via a secure HTTPS…

Placeholder Image
Admin Bar is Not Displayed

If you cannot see the admin bar on the front-end after enable WP Fastest Cache, you should enable the Logged-in…

Placeholder Image
Utf-8 Character Encoding Problem

HTML files are typically served as text/html. The character encoding (or ‘charset’) of this file is UTF-8. If the page…