Quantcast
Channel: Disable Sprockets asset caching in development - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by hammady for Disable Sprockets asset caching in development

$
0
0

The accepted answer is not doing it correctly and it degrades the performance in development by disabling cache totally. Answering your original question, you want changes to referenced files to invalidate the asset cache even if not included directly.

The solution is by simply declaring such dependency such that sprockets knows that the cache should be invalidated:

# layout.html.erb
<% depend_on Rails.root.join('app').join('views').join('_partial.html.erb') %>
# replace the above with the correct path, could also be relative but didn't try

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>