4 ms·
> and there are users who always need to be served by our main (uncached) application servers. This includes anyone who logs into an account, as they see a cus
by jedberg 12y ago
> and there are users who always need to be served by our main (uncached) application servers. This includes anyone who logs into an account, as they see a customized version of Wikipedia pages that can’t be served as a static cached copy
I keep hearing this, but it isn't true anymore. For something like wikipedia, even when I'm logged in, 95% of the content is the same for everyone (the article body). You can still cache that on an edge server, and then use javascript to fill in the customizations afterwards. This will get you two wins: 1) The thing the person is most likely interest in will load quickly (the article) and 2) your servers will have a drastically reduced load because most of the content still comes from the cache.
The tradeoff of course is complexity. Testing a split cache setup is definitely harder and more time consuming as is developing towards it. But given the page views of Wikipedia, would be totally worth it.
- qopp 12y agoYou don't necessarily need a split cache. Just serve some extra javascript to all users that only performs the extra work if there is presence of a cookie. (Also make sure the javascript sets a cookie so that wikipedia can fall back to non-cached if javascript isn't enabled.)
- gaius 12y agoYeah LiveJournal was doing that with memcached like 10 years ago.
- twic 12y agoYou don't even need to use JavaScript - you can do it in the cache with edge-side includes: https://www.varnish-cache.org/docs/3.0/tutorial/esi.html https://www.varnish-cache.org/docs/3.0/tutorial/esi.html
- natrius 12y agoAfter using ESIs with Varnish for a project, I'd never do it again. Cached static pages with Javascript that pulls in the dynamic parts is an easier solution to maintain and has better failure modes.
- twic 12y agoInteresting! Could you tell me more about the problems you found with ESI?
- driverdan 12y agoMy offhand guess is that they want editors to always see the current version of the page whereas caches may be stale.