cache
Signed-off-by: Jeff <jeff@gotenzing.com>
Showing
1 changed file
with
8 additions
and
8 deletions
| ... | @@ -5,14 +5,14 @@ function pull_posts_for_post_list( $data ) { | ... | @@ -5,14 +5,14 @@ function pull_posts_for_post_list( $data ) { |
| 5 | $request_uri = sanitize_text_field($_SERVER['REQUEST_URI']); | 5 | $request_uri = sanitize_text_field($_SERVER['REQUEST_URI']); |
| 6 | $request_uri = base64_encode($request_uri); | 6 | $request_uri = base64_encode($request_uri); |
| 7 | 7 | ||
| 8 | // $BYPASS_CACHE = false; | 8 | $BYPASS_CACHE = false; |
| 9 | // $client = new Predis\Client(); | 9 | $client = new Predis\Client(); |
| 10 | 10 | ||
| 11 | // if(!$BYPASS_CACHE) { | 11 | if(!$BYPASS_CACHE) { |
| 12 | // if($client->exists($request_uri)) { | 12 | if($client->exists($request_uri)) { |
| 13 | // return unserialize($client->get($request_uri)); | 13 | return unserialize($client->get($request_uri)); |
| 14 | // } | 14 | } |
| 15 | // } | 15 | } |
| 16 | 16 | ||
| 17 | $categories = sanitize_textarea_field($_REQUEST['categories']); | 17 | $categories = sanitize_textarea_field($_REQUEST['categories']); |
| 18 | $segment = trim(sanitize_textarea_field($_REQUEST['segment'])); | 18 | $segment = trim(sanitize_textarea_field($_REQUEST['segment'])); |
| ... | @@ -71,7 +71,7 @@ function pull_posts_for_post_list( $data ) { | ... | @@ -71,7 +71,7 @@ function pull_posts_for_post_list( $data ) { |
| 71 | 71 | ||
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | // $client->set($request_uri, serialize(['posts'=>$new_posts,'last_index'=>0]), 'ex', 3600); | 74 | $client->set($request_uri, serialize(['posts'=>$new_posts,'last_index'=>0]), 'ex', 3600); |
| 75 | 75 | ||
| 76 | return ['posts'=>$new_posts,'last_index'=>0]; | 76 | return ['posts'=>$new_posts,'last_index'=>0]; |
| 77 | 77 | ... | ... |
-
Please register or sign in to post a comment