I made my own decision in the generate_appcahe_manifest.rake file and put it in the /lib/tasks folder.
task :generate_appcache_file => ['deploy:precompile_assets', 'html5_manifest'] desc "Create html5 manifest.appcache" task :html5_manifest => :environment do puts 'Creating appcache manifest file...' File.open("public/manifest.appcache", "w") do |f| f.write("CACHE MANIFEST\n") f.write("# Version #{Time.now.to_i}\n\n") f.write("CACHE:\n") assets = Dir.glob(File.join(Rails.root, 'public/assets/**/*')) assets.each do |asset| if File.extname(asset) != '.gz' && File.extname(asset) != '' && File.extname(asset) != '.json' filename_path = /#{Rails.root.to_s}\/public\/(assets\/.*)/.match(File.absolute_path(asset))[1].to_s
Therefore, when I run rake generate_appcache_file on the terminal, I got the /public/manifest.appcache file with assets compiled like this:
CACHE MANIFEST
Finally, I call this file in the /app/views/layouts/app.html.erb file:
<!DOCTYPE html> <html lang="en" manifest="/manifest.appcache">
More information about the standalone application cache, which helps me a lot, can be found here .
source share