cache asset pipeline files in development mode #29

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
1 participant

gabetax commented Feb 12, 2014

Previously, unless configuration.assets.enabled, which is false in development by default, rack-offline would fall back by to the Rails 2.x public/{javascripts,stylesheets} files. This behavior made the default configuration useless unless the developer continuously runs rake assets:precompile after each asset change.

The new behavior causes it to cache every file that would be present in public/assets/ after running a rake assets:precompile. The logic is from:

https://github.com/sstephenson/sprockets/blob/master/lib/sprockets/manifest.rb#L115-L116

Additionally, it now checks the configured assets directory prefix, instead of using the hard-coded "assets".

gabetax added some commits Feb 12, 2014

cache asset pipeline files in development mode
Previously, unless `configuration.assets.enabled`, which is false in
development by default, rack-offline would fall back by to the Rails 2.x
public/{javascripts,stylesheets} files. This behavior made the default
configuration useless unless the developer continuously runs `rake
assets:precompile` after each asset change.

The new behavior causes it to cache every file that _would be present_ in
public/assets/ after running a `rake assets:precompile`. The  logic is from:

https://github.com/sstephenson/sprockets/blob/master/lib/sprockets/manifest.rb#L115-L116

Additionally, it now checks the configured assets directory prefix, instead of
using the hard-coded "assets".

gabetax commented Jul 30, 2015

Closing because this repo is unmaintained and I'm tired of looking at it in my pending list. In reality, you're almost never going to want everything in your manifest in production, so this is only truly useful in early development. If someone else takes over this repo, feel free to re-open.

@gabetax gabetax closed this Jul 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment