Skip to content

Commit

Permalink
*Remove use of user id in cache tree
Browse files Browse the repository at this point in the history
  • Loading branch information
pcfreak30 committed Mar 27, 2017
1 parent d7429c6 commit 00c914c
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions includes/class-rocket-async-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,8 @@ public function process_css_buffer( $buffer ) {
}
$post_cache_id [] = $post_cache_id_hash;
if ( is_user_logged_in() ) {
$post_cache_id [] = wp_get_current_user()->roles[0];
$post_cache_role_id = $post_cache_id;
$post_cache_role = $this->get_cache_fragment( $post_cache_id );
if ( ! empty( $post_cache_role ) ) {
$post_cache = $post_cache_role;
} else {
$post_cache_id [] = get_current_user_id();
$post_cache = $this->get_cache_fragment( $post_cache_id );
}
$post_cache_id [] = wp_get_current_user()->roles[0];
$post_cache = $this->get_cache_fragment( $post_cache_id );
}
if ( ! empty( $post_cache ) ) {
// Cached file is gone, we dont have cache
Expand Down Expand Up @@ -547,9 +540,6 @@ public function process_css_buffer( $buffer ) {
if ( ! empty( $css ) ) {
rocket_put_content( $filename, $css );
$href = get_rocket_cdn_url( set_url_scheme( str_replace( ABSPATH, trailingslashit( $home ), $filename ) ) );
if ( empty( $post_cache_role ) ) {
$this->update_cache_fragment( $post_cache_role_id, compact( 'filename', 'href' ) );
}
$this->update_cache_fragment( $post_cache_id, compact( 'filename', 'href' ) );
}
} else {
Expand Down

0 comments on commit 00c914c

Please sign in to comment.