Skip to content

Commit

Permalink
UHF-X: Fix caching issue in address search
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrsky committed Dec 7, 2023
1 parent 5987e30 commit 31f7b08
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ public static function sortByAddress(ViewExecutable $view): ViewExecutable {
(float) $result->_entity->get('latitude')->getString(),
(float) $result->_entity->get('longitude')->getString());

// The entity should not be cached since it relies on high-cardinality
// user input.
$result->_entity->mergeCacheMaxAge(0);

// Set the distance to computed field.
$result->_entity->set('distance', $distances[$result->_entity->get('id')->getString()]);
}
Expand Down

0 comments on commit 31f7b08

Please sign in to comment.