Eager load Journey Formatter cache
This cache is used when url_for is called without a named route (ie. when it's called with hash options). Eager loading avoids building the cache on the first call and potentially allows the memory to be shared via CoW on forking servers.
This commit is contained in:
parent
939fd3bc41
commit
591c4aa1ea
@ -104,6 +104,11 @@ def clear
|
||||
@cache = nil
|
||||
end
|
||||
|
||||
def eager_load!
|
||||
cache
|
||||
nil
|
||||
end
|
||||
|
||||
private
|
||||
def extract_parameterized_parts(route, options, recall)
|
||||
parameterized_parts = recall.merge(options)
|
||||
|
@ -386,6 +386,7 @@ def initialize(config = DEFAULT_CONFIG)
|
||||
def eager_load!
|
||||
router.eager_load!
|
||||
routes.each(&:eager_load!)
|
||||
formatter.eager_load!
|
||||
nil
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user