ESI (supported by Varnish and Akamai and with a slightly different syntax by nginx) allows for HTML tag-like commands in the page source like <esi:include src="http://example.com/ssi.php?key=abcd" >
so that the static parts of the page is cached in (for example) Varnish and only the dynamic bits are fetched dynamically. ssi.php is a very small program that connects to, say, memcached reads the value of the specified key and prints it (this esi.php is completely David Strauss' idea). Now, if Drupal would be able to serve page templates and cache the dynamic pieces into memcached then we could scale through the roof. And we are close... patch to follow I just wanted to file the issue so I can link to it from the code comment.
Comment | File | Size | Author |
---|---|---|---|
#13 | 651902-support-esi_13.patch | 1.72 KB | scor |
#11 | 651902-support-esi.patch | 1.73 KB | chx |
#4 | 651902-support-esi.patch | 1.64 KB | Damien Tournoud |
#1 | esi.patch | 1.02 KB | chx |
Comments
Comment #1
chx CreditAttribution: chx commentedNote that there are no cache implementations that return strings on cache_set so this is a completely harmless addition to core. The speed penalty is extremely minimal: one if and that's a simple if (and cache_set is a relatively rare operation). Once this is in we can add a few lines to say memcache.inc to return the ESI command when adequate (like using a cache_esi bin). (Yes, memcache is ported to D7, with tests)
Comment #2
Dries CreditAttribution: Dries commentedInteresting, but the code comments are lacking.
Comment #3
catchjoshk has been working on something similar to this with Panels in D6 apparently, not sure where the patch lives though. In other words subscribing.
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedI think this is actually enough to support ESI properly. It's still a little bit hackish (the only true, non hackish, solution would be to make drupal_render_cache_(get|set)() pluggeable... but that would be a significant API change), but it looks nicer I believe.
Comment #5
chx CreditAttribution: chx commentedI like Damien's version. It really is simple.
Comment #6
mike booth CreditAttribution: mike booth commentedSubscribing.
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedI like it too. Good to go, IMO
Comment #8
pwolanin CreditAttribution: pwolanin commentedthe change to function drupal_render() looks like a minor optimization unrelated to ESI support?
Comment #9
Dries CreditAttribution: Dries commentedLooks ready to me, but I'd like to see this code comment to be expanded a bit more. Let's add one or two more sentences to be a bit more concrete.
Comment #10
webchickComment #11
chx CreditAttribution: chx commentedWritten a long comment. @pwolanin no, we now can cache #prefix and #suffix too.
Comment #12
sunComment #13
scor CreditAttribution: scor commentedremoves a whitespace from #11.
Comment #14
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!
Comment #16
Wim LeersAwesome! :)
Comment #17
brianmercer CreditAttribution: brianmercer commentedsubscribed
Comment #18
ecctao CreditAttribution: ecctao commentedAfter this the tage donot work, How?