diff --git a/controller/action/i18nActions.class.php b/controller/action/i18nActions.class.php index dfd490a1..3fd063ee 100644 --- a/controller/action/i18nActions.class.php +++ b/controller/action/i18nActions.class.php @@ -29,8 +29,11 @@ class i18nActions extends Actions throw new Exception('Please set Config::TRANSIFEX_API_KEY in your configuration.'); } - Response::setHeader(Response::HEADER_CROSS_ORIGIN, "*"); + $json = Transifex::getTranslationResourceFile($project, $resource, $language); - return View::renderJson(Transifex::getTranslationResourceFile($project, $resource, $language)); + Response::setHeader(Response::HEADER_CROSS_ORIGIN, "*"); + Response:setHeader(Response::HEADER_ETAG, md5(static::getContent($json))); + + return View::renderJson($json); } } diff --git a/view/Response.class.php b/view/Response.class.php index eb87b38d..6b73ec56 100644 --- a/view/Response.class.php +++ b/view/Response.class.php @@ -192,11 +192,6 @@ class Response ])); } - public static function setContentEtag() - { - static::setHeader(static::HEADER_ETAG, md5(static::getContent())); - } - public static function enableHttpCache(int $seconds = 300) { static::addCacheControlHeader('max-age', $seconds);