%html %body <%= render_remote "/partial/header" %>
Edge Side Include (ESI) mode (http://en.wikipedia.org/wiki/Edge_Side_Includes)
<html> <body> <esi:include src="/partial/header" .../> </body> </html>
Server Side Includes mode (http://wiki.nginx.org/HttpSsiModule) -- only supports local urls
Note the space in "<!--" is just to make the github markup happy. It wouldn't normally be there.
<html> <body> < !--# include virtual="/partial/header" --> </body> </html>
<html> <body> the actual header here content here </body> </html>
<html> <body> <div data-content-url="/partial/header" class="autoReplace"/> </body> </html>
killall varnishd # reset between tests varnishd -a localhost:8009 -f ./spec/server_example/esi_caching.vcl ruby -I lib server_example/example_server.rb & # see the template curl -i localhost:8009/esi # see the data magically filled in curl -i localhost:8009/esi?no_magic=true
sudo nginx -s stop sudo nginx -c `pwd`/server_example/conf/nginx.conf ruby -I lib server_example/example_server.rb & # see the template curl -i localhost:8009/ssi?no_magic=true # see the data magically filled in curl -i localhost:8009/ssi
# see the template curl -i localhost:8009/synchronous?no_magic=true # see the data magically filled in curl -i localhost:8009/synchronous
RemoteIncludes.setter= are non-threadsafe setters
RemoteIncludes::Backend.setter= are threadsafe setters