I’m from Symfony2 PHP and currently migrating to Rails 4, I have no
knowledge with Rails 3 and before. I’m working on my web project with
one
last todo list to enable dynamic caching in this rails 4. In Symfony2
there are built in function to setup Edge Side Include behavior
effortless. Some of this functionality :
- Sf2 have templating function to insert esi include tag <esi:include
src=“http://…” /> with router name as parameter
{{ render_esi(url(‘latest_news’, { ‘max’: 5 })) }}
- Sf2 have built in reverse proxy gateway to merge cached page which
have esi tag with corresponding response from each included esi tag
url.
Symfony2 comes with a reverse proxy (also called a gateway cache) written
in PHP. Enable it and cacheable responses from your application will start
to be cached right away. Installing it is just as easy. Each new Symfony2
application comes with a pre-configured caching kernel (AppCache) that
wraps the default one (AppKernel). The caching Kernel is the reverse proxy.
I have learning page, action, fragment cache. I also found Rack::ESI.
I
know there are middleware idiom, but I don’t know what it’s. I still
have
no idea how to setup all this info correctly. My esi tag doesn’t
replaced
with corresponding response from esi tag url like in Sf2. I think this
is
because I haven’t configured reverse proxy middleware in my Rails. So my
question is, in Rails 4, how to achieve Edge Side Include and HTTP Cache
Reverse Proxy behavior ?
Regards.