This topic is locked

Increase page load time up to 70% faster

9/6/2016 9:38:40 AM
PHPRunner Tips and Tricks
romaldus author

[size="5"]


[size="5"][color="#0000ff"]Screenshot After Minify :[/size]


Add The Following Code in include/dbcommon.phpjust before the php closing tag?>






//minify html
function sanitize_output($buffer) {
$search = array(

'/\>[^\S ]+/s', // strip whitespaces after tags, except space

'/[^\S ]+\</s', // strip whitespaces before tags, except space

'/(\s)+/s' // shorten multiple whitespace sequences

);
$replace = array(

'>',

'<',

'\\1'

);
$buffer = preg_replace($search, $replace, $buffer);
return $buffer;

}
ob_start("sanitize_output");


More info: http://stackoverflow...age-html-output

admin 9/6/2016

Interesting, does it really improve the speed? You have some links we can check? I.e. a link to page with uncompressed and compressed content?
The reason I'm asking that is because most web servers do have gzip compression enabled already. Content is sent to web browser in zipped form and unzipped by the web browser. Applying this sort of PHP-based minification can only make your page slower.
Always make sure you verify the info you found on the internet.

romaldus author 9/6/2016



Interesting, does it really improve the speed? You have some links we can check? I.e. a link to page with uncompressed and compressed content?
The reason I'm asking that is because most web servers do have gzip compression enabled already. Content is sent to web browser in zipped form and unzipped by the web browser. Applying this sort of PHP-based minification can only make your page slower.
Always make sure you verify the info you found on the internet.


unfortunately i have only one example which is my customer's website (password protected), hosted in hostgator. www.hsccweb.com

Perhaps other phprunner users can test it in their website

admin 9/6/2016

But did you at least test it on your site? You can always put this sort of thing to Demo Account and let us all see the results. Otherwise I'll have to delete this thread as potentially bad advise.

romaldus author 9/6/2016



But did you at least test it on your site? You can always put this sort of thing to Demo Account and let us all see the results. Otherwise I'll have to delete this thread as potentially bad advise.


post to demo account tommorow morning. All my phprunner projects are in my computer in the office

romaldus author 9/6/2016



Interesting, does it really improve the speed? You have some links we can check? I.e. a link to page with uncompressed and compressed content?
The reason I'm asking that is because most web servers do have gzip compression enabled already. Content is sent to web browser in zipped form and unzipped by the web browser. Applying this sort of PHP-based minification can only make your page slower.
Always make sure you verify the info you found on the internet.


Demo app with minified html output : Demo

Myr0n 9/9/2016



Demo app with minified html output : Demo


Hi
I tested this with version 8.1 regular themes works very nice, but with the version 9.0 bootstrap has some issues does not show images

admin 9/9/2016

But minified page loads slower than the same exact normal page for the reason I explained above. What is the point?
Regular page:

http://xlinesoft.com/livedemo/phprunner/livedemo5/customers_list.php
Minified page:

http://demo.asprunner.net/romaldus_gmail_com/events/customers_list.php
What is the point?