Why doesn't the Rails cache resource work for JS in a staging environment?

I have CSS and JS for caching in RAILS_ROOT/app/views/layouts/application.html.erb:

<%= stylesheet_link_tag 'reset', ...
                        'layout', 'colors', :cache => 'cache/all' %>
<%= javascript_include_tag 'jquery-1.3.2.min', ...
                           'application', :cache => 'cache/all' %>

If I turn on caching in my development environment, everything will work as planned:

# in RAILS_ROOT/config/environments/development.rb:
config.action_controller.perform_caching = true

When I put the same line in the stage, however, it is /stylesheets/cache/all.cssgenerated correctly, but /javascripts/cache/all.cssnot. The string is created in HTML as if it were:

<script src="/javascripts/cache/all.js?1253556008" type="text/javascript"></script>

Going to this URL gives an empty JS file (although not 404, oddly enough). There is no file in the file system (in the section RAILS_ROOT/public/javascripts/cache/all.js).

Any thoughts?

+3
source share
1 answer

, all.js , . , Rails, , , , - - - , , .

+3

Source: https://habr.com/ru/post/1718210/


All Articles