Skip to main content

cache_key

Function cache_key 

Source
pub fn cache_key(request: &Request) -> (String, Value)
Expand description

The request’s response cache key and what it is made of, as the PHP package’s CacheKey makes them: the method (HEAD as GET), path, pinned version, client (guest without one) and query, with include and fields values in any order. The key is the same in both packages.

A user signed in through Laravel’s own guards without being an API client gets the guest key, which the PHP package scopes to the user instead. Before caching anything that is not the same for every caller under this key, check request.authenticated(), as CacheResponse does.