Re:The Mozilla Developer Network has a New Face
by chad_oliver on Monday December 09, 2013 @04:55PM
(#6877329)
Since most pages would be read far more often than they are written, you could probably get good results by 'compiling' the page to a static cache after each edit.
Re:The Mozilla Developer Network has a New Face
by ubernostrum on Monday December 09, 2013 @06:27PM
(#6877840)
I think you underestimate just how fast and furious the edits can fly on MDN.
Re:The Mozilla Developer Network has a New Face
by iagooar on Monday December 09, 2013 @05:41PM
(#6877604)
I would go that way too. Static content export, put a CDN in front of it, and response times will get < 100ms, even < 80ms.
I have done some experiments with static exports using dynamic frameworks like Rails, and man, it really makes a huge difference. Of course, if your content is mainly static.
Re:The Mozilla Developer Network has a New Face
by lmorchard on Tuesday December 10, 2013 @08:50AM
(#6880657)
Rendering page content after edits is exactly what we do. Most page views are served up from a pre-built cache, either from a straight caching HTTP proxy or from a single DB column.
Re:The Mozilla Developer Network has a New Face
by groovecoder on Monday December 09, 2013 @05:03PM
(#6877374)
Yes, that's exactly what we do:
https://github.com/mozilla/kuma/blob/master/apps/wiki/models...
Re:The Mozilla Developer Network has a New Face
by riffraff on Monday December 09, 2013 @05:36PM
(#6877571)
pardon me, but is that function writing to the database for each page view?
Re:The Mozilla Developer Network has a New Face
by shabble on Monday December 09, 2013 @07:07PM
(#6878038)
No, only views which hit a stale copy of the rendered page and have to call that render() function. Normal views would (I imagine, I haven't traced it back) use the get_rendered() instead, which checks that the cached version is current and schedules a re-rendering (which obviously requires DB writes anyway) if necessary.
Re:The Mozilla Developer Network has a New Face
by handsomeransoms on Monday December 09, 2013 @06:01PM
(#6877709)
Yeah - looks like it's emulating a lock so only one page can be rendered at a time (plus the overhead for database IO to maintain the lock). Is this really the best way to go about this?
Re:The Mozilla Developer Network has a New Face
by shabble on Monday December 09, 2013 @07:09PM
(#6878056)
Unless I'm missing something important, it's locking so the same page can only be rendering once at a time; if another request that would cause a rebuild comes in while a previous rebuild is still in progress, it gets bounced.
Re:The Mozilla Developer Network has a New Face
by lmorchard on Tuesday December 10, 2013 @08:33AM
(#6880575)
Yes, you are correct. We're trying to limit the system to one rendering per page at a time.
Re:The Mozilla Developer Network has a New Face
by avidal on Monday December 09, 2013 @05:55PM
(#6877684)
Seems to me it's actually writing to the database twice for each page view; once to update the render_started_at property on #845, and once again on #881.
https://developer.mozilla.org/en-US/docs/Project:MDN/Kuma