4 ms·
It's worth noting that sometimes you only have content that differs for your "logged in" users. Or, content that is the same with the exception of actions that
by ericcholis 14y ago
It's worth noting that sometimes you only have content that differs for your "logged in" users. Or, content that is the same with the exception of actions that a user has taken on your site. Say, in the case of a shopping cart.
In that use case, you might find that one cache covers everything except their shopping cart preview. This is where ESI (Edge Side Includes) come in. I've never used it in practice, but the idea is similar to server side includes of yesteryear. Here's a good article:
http://blog.redfin.com/devblog/2010/05/esi_and_caching_trickery_in_varnish.html http://blog.redfin.com/devblog/2010/05/esi_and_caching_trick...
- dminor 14y agoAnother option is to populate the cart preview via an ajax request, which allows the initial page to be served entirely from the cache.
- asm89 14y agoYes, edge side includes are very interesting indeed! We used that for scenarios like you describe, but there are actually some things you should take into consideration when using them. Maybe I can dedicate a blog post to that! :)
- ericcholis 14y agoPlease do, I'd love to learn from somebody else's experience with them