Module: Middleman::CachingProxy::Extension::InstanceMethods

Defined in:
lib/middleman/caching_proxy/extension.rb

Instance Method Summary collapse

Instance Method Details

#proxy_with_cache(path:, template:, proxy_options:, fingerprint:) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/middleman/caching_proxy/extension.rb', line 22

def proxy_with_cache(path:, template:, proxy_options:, fingerprint:)
  item = CacheItem.new(
    path: path,
    template: template,
    proxy_options: proxy_options,
    fingerprint: fingerprint
  )
  will_use_cache = extensions[:caching_proxy].add(item)
  if !will_use_cache
    proxy item.path, item.template, item.proxy_options
  end
end