Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
MSF
/
msf-climate-hub
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
53057059
authored
2023-11-21 18:42:15 -0500
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
cache
Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent
5c1fd621
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
wp-content/themes/msf-child/inc/rest.php
wp-content/themes/msf-child/inc/rest.php
View file @
5305705
...
...
@@ -5,14 +5,14 @@ function pull_posts_for_post_list( $data ) {
$request_uri
=
sanitize_text_field
(
$_SERVER
[
'REQUEST_URI'
]);
$request_uri
=
base64_encode
(
$request_uri
);
//
$BYPASS_CACHE = false;
//
$client = new Predis\Client();
$BYPASS_CACHE
=
false
;
$client
=
new
Predis\Client
();
//
if(!$BYPASS_CACHE) {
//
if($client->exists($request_uri)) {
//
return unserialize($client->get($request_uri));
//
}
//
}
if
(
!
$BYPASS_CACHE
)
{
if
(
$client
->
exists
(
$request_uri
))
{
return
unserialize
(
$client
->
get
(
$request_uri
));
}
}
$categories
=
sanitize_textarea_field
(
$_REQUEST
[
'categories'
]);
$segment
=
trim
(
sanitize_textarea_field
(
$_REQUEST
[
'segment'
]));
...
...
@@ -71,7 +71,7 @@ function pull_posts_for_post_list( $data ) {
}
//
$client->set($request_uri, serialize(['posts'=>$new_posts,'last_index'=>0]), 'ex', 3600);
$client
->
set
(
$request_uri
,
serialize
([
'posts'
=>
$new_posts
,
'last_index'
=>
0
]),
'ex'
,
3600
);
return
[
'posts'
=>
$new_posts
,
'last_index'
=>
0
];
...
...
Please
register
or
sign in
to post a comment