afeld / magickly

image manipulation as a (plugin-able) service
http://magickly.afeld.me
MIT License
180 stars 35 forks source link

Add Rack::Cache support #21

Closed jcn closed 11 years ago

jcn commented 11 years ago

Since we're now ready for cedar deployment, it probably makes sense to also include Rack::Cache. I have a branch that just uses this in all environments and uses a filesystem-based store which works quite nicely. I'm not sure of the implications of this (whether we want to give people the option to not use Rack::Cache, etc).

One thing I was thinking was to just allow it to be turned on and off using an environment variable, but I'm wondering if it just makes sense to leave it in and say "this is the way it's done."

afeld commented 11 years ago

I think it's ok to put it in the Gemfile, just not the .gemspec. We can make it more clear in the README that the repo (not the gem) is intended to be used on Heroku, though it may work easily in other places as well.

Maybe the configuration can be done in the config.ru file, which wouldn't be used by the gem. Environment variable is also an option.

tolsen commented 11 years ago

Yes, please leave Rack::Cache dependency as optional when using the gem. For jux.com , we currently turn Rack::Cache off in production so that we can leave it to Apache's cache and not use jruby runtimes to serve cached images.

jcn commented 11 years ago

Oh definitely leaving this out of the gemspec. This is what I was thinking:

https://github.com/jcn/magickly/compare/cache

afeld commented 11 years ago

That sounds good. We should add a README section saying what's special about the repo version vs. the gem.