Method: Nitro::Caching::Output::ClassMethods#do_cache_output

Defined in:
lib/nitro/caching/output.rb

#do_cache_output(path, content) ⇒ Object



49
50
51
52
53
54
# File 'lib/nitro/caching/output.rb', line 49

def do_cache_output(path, content)
  filepath = output_cache_path(path)
  FileUtils.makedirs(File.dirname(filepath))
  File.open(filepath, 'w+') { |f| f.write(content) }
  Logger.debug "Cached page '#{filepath}'" if $DBG
end