R
R
root092016-04-26 03:18:15
Laravel
root09, 2016-04-26 03:18:15

How does cache work in Laravel?

Tell me, Lavel has a cache, for example: How can I add an element to the cache for only one user? That is, I have user statistics, how can I cache it for each user?
Cache::put('key', 'value', $minutes);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Muhammad, 2016-04-26
@root09

You can add a user ID to the key.

A
Andrzej Wielski, 2016-04-26
@wielski

md5 mysql query with all parameters. If there are results in the cache for the request, output from there. No - make a request, save to the cache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question