﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 46465,Implement logic that performs PHP code after connection with client is closed,umchal,,"Hi there, It would be great if this can be implemented in the core. When I write plugins, it is almost unavoidable to perform extra database queries like accessing a custom database table, updating rows, and scheduling WP Cron actions etc. The problem is that it affects the page load time. I've been wondering how this can be avoided and how the impact on the performance can be made minimum from the user experience perspective. And I came up with a little technique using `header('Content-Length: n')` and `header('Connection: close' )`. Here is a working example plugin. {{{#!php