Skip to content

Commit

Permalink
Fix render cache max age on Apigee entities (#917)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxr576 authored Aug 25, 2023
1 parent cdb5be1 commit a096101
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/apigee_edge_teams/src/Entity/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,4 +387,11 @@ protected static function propertyToBaseFieldBlackList(): array {
]);
}

/**
* {@inheritdoc}
*/
public function getCacheMaxAge(): int {
return \Drupal::config('apigee_edge.team_settings')->get('cache_expiration');
}

}
7 changes: 7 additions & 0 deletions modules/apigee_edge_teams/src/Entity/TeamApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,11 @@ protected function urlRouteParameters($rel) {
return $params;
}

/**
* {@inheritdoc}
*/
public function getCacheMaxAge(): int {
return \Drupal::config('apigee_edge.team_app_settings')->get('cache_expiration');
}

}
6 changes: 6 additions & 0 deletions src/Entity/ApiProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,4 +328,10 @@ public function setScopes(string ...$scopes): void {
$this->decorated->setScopes(...$scopes);
}

/**
* {@inheritdoc}
*/
public function getCacheMaxAge(): int {
return \Drupal::config('apigee_edge.api_product_settings')->get('cache_expiration');
}
}
7 changes: 7 additions & 0 deletions src/Entity/Developer.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,4 +519,11 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti
$storage->resetCache($developer_mail_id_map);
}

/**
* {@inheritdoc}
*/
public function getCacheMaxAge(): int {
return \Drupal::config('apigee_edge.developer_settings')->get('cache_expiration');
}

}
6 changes: 6 additions & 0 deletions src/Entity/DeveloperApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,10 @@ protected function urlRouteParameters($rel) {
return $params;
}

/**
* {@inheritdoc}
*/
public function getCacheMaxAge(): int {
return \Drupal::config('apigee_edge.developer_app_settings')->get('cache_expiration');
}
}

0 comments on commit a096101

Please sign in to comment.