HOW TO increase your website speed / approve script response time?

Discuss everything related to ApPHP Durecty CMF. All versions. Any questions related to the Directy CMF developing or using should be posted to this forum.

Moderators: alexandrleonenko, alexmst

administrator
Site Admin
Site Admin
Posts: 6169
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO increase your website speed / approve script response time?

Postby administrator » Oct 20th, '18, 14:04

There are a lot of methods that allows you to increase your website speed and response time.
Part of them related to programming and may be done on code-level, but some of them you may do by yourself, defining right configuration.

First of all check your website with Google perfect tool, it will help you to understand what happens on your site and how you can improve your response time:
https://developers.google.com/speed/pagespeed/insights/

Next, let see what we can do in config file, that may increase website speed.

The important part of the speed is a time that takes to server to send a page to visitor's browser.
It can be easily reduced by compressing the content that server sends to the client side.

In protected/config/main.php you have:

Code: Select all

// Output compression
'compression' => array(
   'gzip' => array('enable' => false),
   'html' => array('enable' => false),
   'css' => array('enable' => false, 'path' => 'assets/minified/css/', 'minify' => array('frontend'=>true, 'backend'=>false)),
   'js' => array('enable' => false, 'path' => 'assets/minified/js/', 'minify' => array('frontend'=>true, 'backend'=>false)),
),


1. First option allows to enable gzip compression.
Gzip compression simply compresses data when sends it to browser and browser decompess it before showing on page.
You may read more about this here:
https://www.apphp.com/tutorials/index.p ... evelopment
To enable gzip compressing simply set

Code: Select all

'gzip' => array('enable' => true)


2. Second option is HTML compression.
HTML compression simply minifies your HTML (removes double spaces, optional tags and other unneeded symbols), so your HTML weights less.
Let say it may reduce HTML weight up to 30-40%, and if your original HTML was 100K you save at least 30K on every page view.
To enable gzip compressing simply set

Code: Select all

'html' => array('enable' => true)


3. Third option is CSS compression.
CSS compression allows you to combine all CSS files into one CSS file and also minify their code.

4. Forth option is JS compression.
JS compression allows you to combine all JS files into one JS file and also minify their code.


Minification (also minimisation or minimization or minifying), in computer programming languages is the process of removing all unnecessary characters from source code without changing its functionality.

In DEBUG mode you may see compression results in debug panel.
Untitled.png
Untitled.png (44.24 KiB) Viewed 2818 times

Return to “ApPHP Directy CMF {developers/users}”