Simple asset caching, without time-based expiry. Adds support for `turbo-sprockets-rails3` #43

Closed
wants to merge 1 commit into
from

5 participants

@ndbroadbent

This is an alternative to #42, which simply removes any assets that aren't referenced by manifest.yml.

It provides a strong guarantee that the public/assets cache won't grow out of control, by clearing the cache if any exceptions are raised during the cleanup. I know it's usually not a good idea to rescue Exception, but you never know what might happen when you're dealing with 2.2 million apps. Anything could be monkey-patched by a rogue gem, and anything could break :)

Since most Rails 3 apps won't benefit from this caching unless they are using my turbo-sprockets-rails3 gem, I think it would be appropriate to add the following conditional:

if File.read('Gemfile.lock').include?('turbo-sprockets-rails3')
  # assets caching code ...

Let me know what you think about that.

Note that cache_load "public/assets" at the beginning doesn't need to be conditional, since it just won't do anything if public/assets isn't cached.

@ndbroadbent

Have opened a pull request with the turbo-sprockets-rails3 conditional at #44

@sbleon

👍

@maletor

👍

@jjb jjb referenced this pull request in ndbroadbent/turbo-sprockets-rails3 Jun 27, 2013
Closed

issue with 3.2.9 and heroku #33

@schneems schneems closed this Feb 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment