mozilla/kuma — pull request #318 by lmorchard (2012-06-27 21:49:56+00:00)
Title: bug 766252: Deferred and singleton page rendering

* Documents can be rendered on demand or offloaded into the Celery queue

* Documents with `defer_rendering == True` are rendered with Celery
queue tasks. Otherwise, rendering is attempted on demand during
the request/reasponse cycle.

* If a Document takes too long to render, `defer_rendering` is
automatically set to True. This time limit is controlled by
KUMA_DOCUMENT_FORCE_DEFERRED_TIMEOUT in Constance settings

* Allow only one rendering per Document at any given time. Additional
attempts to render a Document while already in progress results in a
warning message and/or stale content while the rendering finishes.

* Rendered content is now kept in the DB, rather than temporary cache

* Lots of additional Document fields to track rendering state, store
rendered content, and control deferred rendering.

* Reload no longer triggers a render of the page. However, editing and
saving a Document does.

* Shift-Reload by a logged-in user schedules a fresh render, assuming
there's not one already in progress.

* Display warning messages about the render status of a page. But, only
for logged-in users to keep search engine crawlers from indexing them.

* Display detailed Kumascript errors only to logged in users, also to
avoid search indexing.

* Document rendering via kumascript refactored out of views.py and into
models.py and kumascript.py

* Disable schedule_rebuild_kb and _maybe_schedule_rebuild in favor of
new Document rendering system.

* Tweaks to Document admin to allow mass enable/disable of deferred
rendering, link to public URL of Documents.

* Reenable celery queue in settings_local, tweaks to failing tests

* manage.py command for manually triggering or queuing a page render