PHP Interface Webiny\Component\Rest\Interfaces\CacheKeyInterface

Implement this interface to define your own method for generating a cache key. Some common use cases are to generate a cache key based on some cookie or token. Note that you should still include the url, query parameters and the http method. Always take into account that generating the cache key doesn't actually take longer than getting the data without cache.
Afficher le fichier Open project: Webiny/Framework

Méthodes publiques

Méthode Description
getCacheKey ( ) : string Computes and returns a cache key.

Method Details

getCacheKey() public méthode

Best practice is hash it with some hashing algorithm like md5 or sha1. Note that the returned key is used "as it is", nothing is appended to it.
public getCacheKey ( ) : string
Résultat string Cache key.