decrease the size of Expression2 LRU cache to store 5 themes

This commit is contained in:
Michael Go
2025-01-07 14:32:07 -04:00
parent 8ecb703d4d
commit 1de6025362
+1 -1
View File
@@ -68,7 +68,7 @@ module Liquid
# Use an atomic group (?>...) to avoid pathological backtracing from
# malicious input as described in https://github.com/Shopify/liquid/issues/1357
RANGES_REGEX = /\A\(\s*(?>(\S+)\s*\.\.)\s*(\S+)\s*\)\z/
CACHE = LruRedux::Cache.new(1_000_000) # most themes would have less than 2,000 unique expression
CACHE = LruRedux::Cache.new(10_000) # most themes would have less than 2,000 unique expression
class << self
def string_scanner