You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 10, 2019. It is now read-only.
It is not clear for me how can I cache output result of a complex query.
Let's say I query car accessories together with related cars and other related stuff:
public function resolve($root, $args, $context, $info)
{
...
$result = Accessories
::where($where)
->get();
if (Cache::store('redis')->has('all_accessories')) {
$result = Cache::store('redis')->get('all_accessories');
} else {
Cache::store('redis')->put('all_accessories', $result, 10080);
}
return $result;
}
If I cache it like this then all relations won't be cached. Because the result does not contain any of them
at the moment of caching. How should i cache it?
The text was updated successfully, but these errors were encountered:
In my application I am utilizing https://github.com/GeneaLabs/laravel-model-caching/. It covers majority of my caching needs. So far the only downside (and it's been noted) is that it currently does not support belongsToMany caching when being lazy-loaded.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It is not clear for me how can I cache output result of a complex query.
Let's say I query car accessories together with related cars and other related stuff:
If I cache it like this then all relations won't be cached. Because the result does not contain any of them
at the moment of caching. How should i cache it?
The text was updated successfully, but these errors were encountered: