Allow caching of WP feed by WP Rocket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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