Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

ndbroadbent
Copy link

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
Copy link
Author

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

@neersighted
Copy link

👍

2 similar comments
@sbleon
Copy link
Contributor

sbleon commented Mar 4, 2013

👍

@maletor
Copy link

maletor commented Mar 12, 2013

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants