diff --git a/src/applications/differential/parser/DifferentialChangesetParser.php b/src/applications/differential/parser/DifferentialChangesetParser.php index 646e1b65b1..35f6cef856 100644 --- a/src/applications/differential/parser/DifferentialChangesetParser.php +++ b/src/applications/differential/parser/DifferentialChangesetParser.php @@ -61,6 +61,7 @@ final class DifferentialChangesetParser { private $highlightErrors; const CACHE_VERSION = 6; + const CACHE_MAX_SIZE = 8e6; const ATTR_GENERATED = 'attr:generated'; const ATTR_DELETED = 'attr:deleted'; @@ -746,6 +747,11 @@ final class DifferentialChangesetParser { } $cache = json_encode($cache); + // We don't want to waste too much space by a single changeset. + if (strlen($cache) > self::CACHE_MAX_SIZE) { + return; + } + try { $changeset = new DifferentialChangeset(); $conn_w = $changeset->establishConnection('w');