While create REST resource in Drupal 8, ResourceResponse method used to return response. But it cache the response data.
If you don't want to store response in cache, use this code
If you don't want to store response in cache, use this code
$build = [ '#cache' => [ 'max-age' => 0, ], ]; return (new ResourceResponse($response, $response_code))->addCacheableDependency($build);
Comments
Post a Comment