Closed carlcs closed 3 years ago
Thanks for accepting #145. After your cleanup I’m now unable to (easily) set a cacheKey and disable caching for dev environments.
cacheKey
This is the config I was using before
'defaults' => static function() { $isDev = App::env('ENVIRONMENT') === 'dev'; $request = Craft::$app->getRequest(); return [ 'cache' => $isDev ? false : 'P1Y', // one year 'cacheKey' => implode(':', [ 'elementapi', Craft::$app->getSites()->getCurrentSite()->id, $request->getPathInfo(), $request->getQueryStringWithoutPath(), $request->getHeaders()->get('X-API-Token'), ]), ]; },
Error message after updating to 2.8
Setting unknown property: craft\elementapi\resources\ElementResource::cacheKey
Ahh that makes sense. Thanks.
2.8.1 is out now with that change.
Description
Thanks for accepting #145. After your cleanup I’m now unable to (easily) set a
cacheKey
and disable caching for dev environments.This is the config I was using before
Error message after updating to 2.8