users can provide optional expression cache

This commit is contained in:
Michael Go
2025-01-07 14:32:46 -04:00
parent 2c7d686690
commit 42d822bda9
4 changed files with 47 additions and 4 deletions
+3 -1
View File
@@ -89,7 +89,9 @@ module Liquid
# Cache only exists during parsing
if cache
cache.fetch(markup) { inner_parse(markup, ss, cache).freeze }
return cache[markup] if cache.key?(markup)
cache[markup] = inner_parse(markup, ss, cache).freeze
else
inner_parse(markup, ss, nil).freeze
end