Ruby on Rails Wednesday, April 2, 2014

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
http://symfony.com/doc/current/book/http_cache.html#using-edge-side-includes
{{ 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.
http://symfony.com/doc/current/book/http_cache.html#edge-side-includes 
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.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8ec5d95b-cd7d-49aa-abdc-db92dfa1e835%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment