I have a few scenarios which I will eventually need to consider in a few months time. Just throwing the question out there so that I can mull on the discussion in the mean time.
I am using Zend Framework for my application stack. I'm using APC for server caching (rather than memcache since as I don't believe memcache offers any benefit for me even though my application is distributed.)
My application has been built to work without JavaScript, and then for JavaScript support I break the page down and render the JavaScript friendly version.
If you analyse a simple page, maybe 80% of it is core functionality, which can be cached for every user. Then 20% of it is customized for that user. For example, I might want to display
- Last 5 viewed Items
- Favourited Items
These two "widgets" would be specific for each user. I was considering using ESI for these components, but then I figured that the most consuming aspect of any/my Zend Framework application is the bootstrapping and dispatch process. So if my application takes 80ms currently without caching. Like 90% of the relative time is spent in the bootstrap and on Plugin hooks, if I were to use ESI to load these two "widgets", then I would effectively be adding load to each page? Since I would be initiating another 80ms request for each cached page.
In which case, would you advise just loading the customized widgets/snippets via JavaScript, which can be pulled once the initial page has been loaded. The clear benefit of this is that there is only ever one request which is cached, and then anything customized is pulled in a single request after the initial page (which is cached) has been served.
If I'm looking for maximum performance, this seems like the better solution?