By default c.cache is set to false, which means an application always parses a manifest.json. In development, you should set cache false usually. Instead, setting it true which caches the manifest in memory is recommended basically.
However, all of the helpers call get_manifest_by_key which calls Minipack.configuration.manifests. Looking at the source for manifests:
def manifests
raise Error, 'Calling #manifests is only allowed from a root' unless root?
repo = ManifestRepository.new
# Determine if a single manifest mode or multiple manifests(multiple site) mode
targets = @children.empty? ? [self] : @children.values
targets.each do |config|
# Skip sites that a manifest file is not configured
next if config.manifest.nil?
repo.add(config.id, config.manifest, cache: config.cache)
end
repo
end
A new repo is created on every call, which means that new manifest is created on every call, which means that we re-read and parse the manifest file on every call. You can verify this in an irb window. Notice that cache is true but the addresses of the returned manifests are different.
From the configuration file:
However, all of the helpers call
get_manifest_by_key
which callsMinipack.configuration.manifests
. Looking at the source formanifests
:A new
repo
is created on every call, which means that newmanifest
is created on every call, which means that we re-read and parse the manifest file on every call. You can verify this in an irb window. Notice that cache istrue
but the addresses of the returned manifests are different.