0

Here is the related source code:

offline = Rack::Offline.configure :cache_interval => 120 do      
 Rails.application.assets.each_logical_path.select{|e| not e.include? ".pdf"}.
    each {|e| cache "assets/" + e}
 network "/"  
end   
match "/application.manifest" => offline

Generated manifest seems fine, assets too, but it will stop downloading/caching assets in a random step with this message on Chrome: https://muster-apotheke.splettville.com/application.manifest

Appreciate any help.

Jahan Zinedine
  • 14,616
  • 5
  • 46
  • 70

1 Answers1

2

By using the asset_path helper method, I can refer to production assets in cache manifest:

  if Rails.env.production?
    offline = Rack::Offline.configure :cache_interval => 120 do      
      cache ActionController::Base.helpers.asset_path("application.css")
      cache ActionController::Base.helpers.asset_path("application.js")
      network "/"  
    end
    match "/application.manifest" => offline  
  else
    offline = Rack::Offline.configure :cache_interval => 120 do      
      Rails.application.assets.each_logical_path.select{|e| not e.include? ".pdf"}.each {|e| cache "assets/" + e}
      network "/"  
    end    
    match "/application.manifest" => offline  
  end
Jahan Zinedine
  • 14,616
  • 5
  • 46
  • 70