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.
Show file Open project: Webiny/Framework

Public Methods

Method Description
getCacheKey ( ) : string Computes and returns a cache key.

Method Details

getCacheKey() public method

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
return string Cache key.