corpus map data json cahe aware of language
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user