0

여기에 관련된 소스 코드 :HTML5 오프라인 기능은 Heroku가 서버에서 작동하지 않습니다

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 

manifest 잘 보인다 자산을 생성,하지만 그것은/캐싱 자산 다운로드를 중지합니다 Chrome에서이 메시지가 포함 된 임의의 단계 : https://muster-apotheke.splettville.com/application.manifest

감사합니다.

답변

2

asset_path 도우미 방법을 사용하여, 나는 캐시 매니페스트에 생산 ​​자산을 참조 할 수 있습니다 :

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 
관련 문제