Add prerender celery task calling code to middleware.