how would you retrieve the cached data without using a key?
Jul 4, 2019
5
Level 2
Why Keys when accessing a cache
I am trying to learn the basics of caching a database query. There is plenty of examples on how to do so. Except i want to also understand the concept/theory of caching in laravel. None of the material ive seen actually bothers to explain why you need a cache key. SO why must u have a key to access a cache?
Level 122
the key is a label
just like putting the data (the result of a query) into a variable. When you want to access the data you use the variable.
In the cache it puts all the data in a flat space, with the data held under a specific label (key)
1 like
Please or to participate in this conversation.