RubyFlow : Ruby Community Link Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

Rack::ESI gem released

Today I released a small gem, rack-esi. It's a Rack middleware providing almost the same functionality as Varnish. Features include path blacklisting, type whitelisting, recursion limits, include limits, support for <include> alt and noerror attributes. The main target is to simulate a production environment. [more inside..]

Comments

Will this work on Heroku?RoaR - November 26, 2009 00:44
Good to see more implementations :)

I'm not too familiar with Rack; does it use a process per request? Or is it async?

ESI was designed to run in an event-driven, async server.Mark Nottingham - November 26, 2009 02:44
Install (option => default):path blacklisting (:skip => nil, expects Regexp)type whitelisting (:only => /^text\/(?:x|ht)ml/)recursion limit (:depth => 5)include limits (:includes => 32)support for <include> alt and noerror attributes
It’s main target is to simulate production environment.

Installation:
gem install rack-esi
Rails Setup (environment.rb):
config.gem 'rack-esi'
config.middleware.use(Rack::ESI, opts = {})

Links:GithubESI language specification

Cheers
FlorianPeterCooper - November 26, 2009 05:29
Installation

gem install rack-esi

Rails Setup (environment.rb)

config.gem 'rack-esi'
config.middleware.use(Rack::ESI, opts = {})


Sourceboof - November 26, 2009 07:30
RoaR:
Rack-ESI was designed for developing purposes. I don't tried Heroku yet,
but when they run Rack apps it should work. I suggest you use another Cache
middleware between Rack-ESI and [App] since Rack::ESI only replaces ESI
elements. But this is far away from what you want to do with ESI.

Heroku | How It Works shows
where your app is located. A real ESI implementation should work at reverse
proxy level, not at Dyno level.

Mark Nottingham:
Rack is not decoupled from the app like a reverse proxy. The app and rack
live in the same process and when a page is requested Rack::ESI parses the
html with Nokogiri calls the app for includes and replaces them. This
happens synchronously.

As I mentioned before, I coded Rack::ESI for development purposes. As long as
I don't implement the cache and the invalidation protocol to build a reverse
proxy based on Rack the app and the middleware will still use the same
process.
boof - November 26, 2009 08:30

Post a Comment

Note: If you are a registered user, you can log in to populate these fields.

You may use ONLY these HTML tags to format your comment:
<a href="" title=""> <b> <blockquote> <code> <em> <i> <strong>
Do NOT use <p> tags. Just use newlines :-)

c
o
n
U bum
s
B bum
t
g
F tits
e
E tits
t
s
e
n
d