corpus map data json cahe aware of language

This commit is contained in:
2018-05-02 23:48:28 +02:00
parent e4801a87c6
commit 9399f77eb8
@@ -126,14 +126,15 @@ class CorpusController extends ControllerBase {
'count' => count($nodes),
'nodes' => $nodes_data,
'entrees' => $entrees,
'langcode' => $current_langcode,
'language' => $current_langcode,
);
// https://spinningcode.org/2017/05/cached-json-responses-in-drupal-8/
// cache is invalidated in edlp_corpus.module by tags
$data['#cache'] = [
'max-age' => \Drupal\Core\Cache\Cache::PERMANENT,
'tags' => ['rebuild-corpus-cache']
'tags' => ['rebuild-corpus-cache'],
'contexts' => ['languages:language_content'],
];
// $response = new JsonResponse();