rocket_clean_files()

Use the rocket_clean_files() function when you want to purge some specific pages of the cache.

You can use a string, or an array with the URL(s) to purge.

// clean http://your-site.com/contact/
rocket_clean_files( 'http://your-site.com/contact/' );

// clean http://your-site.com/contact and http://your-site.com/legal/
$clear_urls = array(
	'http://your-site.com/contact/',
	'http://your-site.com/legal/'
);
rocket_clean_files( $clear_urls );

Passing a URL to this function will clear the cache from that URL recursively. This means that if you pass a URL, both the exact URL and everything within the URL path will be cleaned, so, passing this: "http://your-site.com/blog/" will cause everything inside /blog/(.*) to be cleared too, you don't have to use a wildcard for it.

It is important to note this function only accepts full URLs, for example: https://mydomain/some-page/ instead of just /some-page/.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.