mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 02:04:38 +00:00
Browser-cache localization strings (+ new API endpoint to get them)
This commit is contained in:
@@ -17,8 +17,13 @@ class BaseApiController extends BaseController
|
||||
parent::__construct($container);
|
||||
}
|
||||
|
||||
protected function ApiResponse(\Psr\Http\Message\ResponseInterface $response, $data)
|
||||
protected function ApiResponse(\Psr\Http\Message\ResponseInterface $response, $data, $cache = false)
|
||||
{
|
||||
if ($cache)
|
||||
{
|
||||
$response = $response->withHeader('Cache-Control', 'max-age=2592000');
|
||||
}
|
||||
|
||||
$response->getBody()->write(json_encode($data));
|
||||
return $response;
|
||||
}
|
||||
|
Reference in New Issue
Block a user