Disable assets caching in development mode

82 views
Skip to first unread message

Michał Bajur

unread,
Apr 21, 2015, 12:27:52 PM4/21/15
to spree...@googlegroups.com
Hello!
I'm trying to run my first production spree project and it obviously involves changing css styles and an overall spree layout and views.
So that's my first step beyond backend spree coding and making extensions. 

Anyway - i want to be able to edit my shop's css files to style it but it seems that spree is caching all my asset files by default so making any
change to a css file involves three steps to see it live - rake assets:clean, rake assets:precompile and restarting a server. Each of these steps takes
up to 20 seconds to be completed so, as you can imagine, styling my shop is a hell and after 2 hours of such work i just wont to die.

Am i missing something elementary? Is there any way to disable such behaviour? I can't find much about that topic on the internet. My development.rb
file looks like that: https://gist.github.com/mbajur/d94ba02306a525bbce85

Thank you for any tips
Mike

Jason Fleetwood-Boldt

unread,
Apr 21, 2015, 12:36:24 PM4/21/15
to spree...@googlegroups.com
Yes, I think what you are missing is that you want to trash the entirety of what you have in public/assets/ folder (including the assets folder itself). Rails will then serve the assets dynamically, correctly expiring them on each request. 

Generally these days you don't keep the public/assets/ folder around, or really even compile assets locally (unless you're doing something special like debugging Sprockets). 

Re-read this guide carefully and make sure you understand every piece of it before moving forward: http://guides.rubyonrails.org/asset_pipeline.html
Reply all
Reply to author
Forward
0 new messages