I'm wondering if it's possible to add HTTP caching for a Goliath API on the Heroku Cedar stack. Is rack-cache compatible with Goliath and em-memcached, or is there some other alternative (except running a reverse proxy, which you can't do on Cedar)?
Hey Bjorn. Yes you can get rack-cache to work (just need to wrap it to make it async friendly). Having said that, on heroku you're much better off making use of their Varnish cache: http://devcenter.heroku.com/articles/http-caching
Simply emit the right headers and the rest is taken care of for you.
> Hey Bjorn. Yes you can get rack-cache to work (just need to wrap it to make it async friendly). Having said that, on heroku you're much better off making use of their Varnish cache: http://devcenter.heroku.com/articles/http-caching
> Simply emit the right headers and the rest is taken care of for you.
Correct, Varnish isn't available on Cedar unfortunately. I haven't found many examples on using rack-cache in an async-friendly way, do you know if this monkeypatch is still required: https://gist.github.com/743620 ?
It has something to do with "advanced HTTP uses" in the new stack. Perhaps functions that Varnish did not support, such as long-polling, chunked replies, something like that. The cedar stack has a less complex inbound request route in order to allow more flexibility in the dyno layer. But that means no varnish, no nginx. Win some, lose some I guess.
I'm surprised nobody offers an "Add-On" to Heroku for Varnish.
On Saturday, February 18, 2012 1:29:28 AM UTC-8, Bjørn Arild Mæland wrote:
> I'm wondering if it's possible to add HTTP caching for a Goliath API on > the Heroku Cedar stack. Is rack-cache compatible with Goliath and > em-memcached, or is there some other alternative (except running a reverse > proxy, which you can't do on Cedar)?
> Thanks,
> Bjørn Arild Mæland
On Tuesday, February 21, 2012 10:41:05 AM UTC-8, Joshua Warchol wrote:
> It has something to do with "advanced HTTP uses" in the new stack.
> Perhaps functions that Varnish did not support, such as long-polling,
> chunked replies, something like that. The cedar stack has a less
> complex inbound request route in order to allow more flexibility in
> the dyno layer. But that means no varnish, no nginx. Win some, lose
> some I guess.
> I'm surprised nobody offers an "Add-On" to Heroku for Varnish.
> On Tue, Feb 21, 2012 at 12:20 PM, Ilya Grigorik wrote:
> > Try it - that's the only way to find out :-)
> > Wasn't aware of the varnish gotcha with Cedar.. Do you guys know why it's
> > not available?