-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redis Caching implementation #24
base: main
Are you sure you want to change the base?
Conversation
thank you for your contribution! Before I review this further, can you merge the current main branch into your fork? Right now there are merge conflicts and unrelated commit changes included because the main branch and your fork have differences that need to be resolved. Thank you in advance! |
@danielbrendel That's my bad! I swore I did that, Let me fix that |
@danielbrendel That should clear the conflicts! |
Thank you! Just two things:
Other than that, we're on a good track! :) I'll set up a Redis environment on my machine as soon as I find a minute. |
To address your first part yes that would be much smarter, to be honest didn’t even think about that lol.
For the second, both my production and development environment used phpredis, I assume because I had installed Redis with composer in testing I completely forgot to add it to the JSON, or it was lost in preparation for the PR
I can fix these issues later today, or tomorrow.
-SRA
|
Hi, I saw you added a dependency to the composer.json, but it seems that you choose the wrong package. Did you mean phpredis instead of predis? The latter one does not expose the used methods to communicate with the redis environment, but the former one does. |
Yes that's my bad, I'm not too familiar with Composer, so I did mean to use phpredis |
I quickly added a database related caching. There is now a Example: /**
* @param $appid
* @param $lang
* @return mixed
*/
public static function cachedSteamApp($appid, $lang)
{
$cache = config('cache');
if ($cache->driver === 'db') {
return json_decode(CacheModel::remember('steam_app_' . $appid . '_' . $lang, $cache->duration, function() use ($appid, $lang) {
return json_encode(SteamApp::querySteamData($appid, $lang));
}));
} else if ($cache->driver === 'redis') {
throw new \Exception('Not implemented yet.'); //Here you can insert the redis related code. A call to a Redis Module would be the best approach here.
} else {
return SteamApp::querySteamData($appid, $lang);
}
} Then you can add all redis stuff to a |
G'day! Just saw this, I'm not going to be able to do work on this project until next month. |
The long-awaited Steam API caching (#16)
This is a fairly simple integration, that is expandable to other Key store systems.
I first tested this with Memcached and verified that it's backward compatible, with a few code changes.
If you have any questions feel free to ask me!
-SRA