So basically I have a section within an internal application which allows users to modify/edit HTML through Summernote.JS
.
The issue I'm facing is a ridiculous load time which I only seem to experience within Chrome.
The HTML content that's being edited has a length of 150252
as there are base64 inline images. The load times are as follows..
Chrome (Version 51.0.2704.106 m): 39.53 seconds
Firefox (Version 43.0.1): 2.08 seconds (onload: 2.74s) - 629.8KB
Internet Explorer (Version 11.0.9600.17843): ~2.8 seconds
Below is an image of the Chrome load times on a complete refresh.
The funny thing is, when I remove the echo of the above content, the page load's instantaneously
<textarea id="content" name="content" placeholder="Simply enter the section content below.."><?php echo $this->section->section; ?></textarea>
Now I've found this old bug on PHP.net (after some serious searching lol) which says that PHP's echo handles the data buffering to the browser via TCP/IP VERY poorly due to the Nagle Algorithm.
Short of saving the content to a temporary file and using readfile()
to fetch the content (which does return the original performance), what else could I do to fix this issue within chrome? Chunk the output data? Without over complicating the process of it.