corpus map data json cahe aware of language
This commit is contained in:
@@ -126,14 +126,15 @@ class CorpusController extends ControllerBase {
|
|||||||
'count' => count($nodes),
|
'count' => count($nodes),
|
||||||
'nodes' => $nodes_data,
|
'nodes' => $nodes_data,
|
||||||
'entrees' => $entrees,
|
'entrees' => $entrees,
|
||||||
'langcode' => $current_langcode,
|
'language' => $current_langcode,
|
||||||
);
|
);
|
||||||
|
|
||||||
// https://spinningcode.org/2017/05/cached-json-responses-in-drupal-8/
|
// https://spinningcode.org/2017/05/cached-json-responses-in-drupal-8/
|
||||||
// cache is invalidated in edlp_corpus.module by tags
|
// cache is invalidated in edlp_corpus.module by tags
|
||||||
$data['#cache'] = [
|
$data['#cache'] = [
|
||||||
'max-age' => \Drupal\Core\Cache\Cache::PERMANENT,
|
'max-age' => \Drupal\Core\Cache\Cache::PERMANENT,
|
||||||
'tags' => ['rebuild-corpus-cache']
|
'tags' => ['rebuild-corpus-cache'],
|
||||||
|
'contexts' => ['languages:language_content'],
|
||||||
];
|
];
|
||||||
|
|
||||||
// $response = new JsonResponse();
|
// $response = new JsonResponse();
|
||||||
|
|||||||
Reference in New Issue
Block a user