Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Allow caching of WP feed by WP Rocket
function wp_rocket_cache_feed( $uri ) {
$feed = '/(.+/)?' . $GLOBALS['wp_rewrite']->feed_base . '/?';
if ( in_array( $feed, $uri ) ) {
$uri = array_flip( $uri );
unset( $uri[ $feed ] );
$uri = array_flip( $uri );
}
return $uri;
}
add_filter( 'rocket_cache_reject_uri', 'wp_rocket_cache_feed' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment