Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

How can I reduce the Waiting (TTFB) time in PHP-Fusion 9.xx

I have installed PHP-Fusion 9.0.3 Andromeda with github. I know that this version is intended for development only. However, I decided to ask: How can I reduce the Waiting (TTFB) time in this version of cms PHP-Fusion 9.03? Maybe there is some special and quick solution to this problem? Or need to analyze and to do everything in the complex, correcting various files and requests?
I have only the video plug-in is installed on the site. The cat_id = 1 page loads for a very long time. I think that the problem is not in the plugin but somewhere in the SMS kernel it is necessary to search. The site can be viewed at: lightxx.ru
Maybe I'm wrong about something. Any advice how to speed up the loading of the page, maybe someone has solved this problem for themselves.
Are you using oPCache? If not, you should. It makes a dramatic difference.

There are also 1 connection errors detected according to pingdom. https://tools.pingdom.com/#!/Bpq0e/http://lightxx.ru/infusions/videos/videos.php?video_id=35
Thanks for the link to pingdom, I will write in support of hosting in connection with this error.

I'm using hosting, with PHP 7.2.8. In the configuration of php.ini, I set such settings :

Quote

max_execution_time=30
memory_limit=128M
upload_max_filesize=64M
post_max_size=128M


OpCache on hosting is enabled, here is the link to ini.php https://s2.lealhost.com/ini.php72

In the htaccess file there is only this :

Quote

#Cache images for 7 days to soften network load
<IfModule mod_headers.c>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header append Vary: Accept-Encoding
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
</IfModule>


I also uploaded the opcache.php file to the hosting, to the root of the site, to check the OPcache Status. From this place https://github.com/rlerdorf/opcache-s...che-status This is what OPcache Status shows on my site :
Memory https://postimg.cc/image/pappv31mj/
Keys https://postimg.cc/image/fdep1w49n/
Hits https://postimg.cc/image/5sv2exmmj/
Visualise Partition https://postimg.cc/image/4qkvwn3vv/
I can add my input is to optimize the queries done on the page. If you have joins, it's good to add foreign keys to the "IDs" column. That can do a lot of speed up as well.

Other than that, all I can finally advice you is that you do a CDN, and run all scripts off CDNs to super speed your site.

On the base of the things, your hosting server environments also makes a lot of difference. Not just OS.
Say upload "blank.php" into root folder, then in CMD, ping http://lightxx.ru/blank.php and see what's the speed like.

Contents of blank.php

CodeDownload  

<?php
require_once __DIR__."/maincore.php";
require_once THEMES."templates/header.php";

echo "Test";

require_once THEMES."templates/footer.php";



.
Thank you Chan for the advice. I talked with the support of my hosting lealhost.com They analyzed my site and found the reason for the slow opening of the pages. I'm using an addon video with github, it's my fault, it's still under development. The reason was in the file ... /infusions/videos/functions.php The download speed of the site varies proportionally with respect to the number of thumbnail images (for video) on the site. Function code problem :

Quote

function GetVideoData($url, $type = 'youtube') {
$json_url = '';
if ($type === 'youtube') {
$url = filter_var($url, FILTER_VALIDATE_URL) == FALSE ? 'https://www.youtube.com/watch?v='.$url : $url;
$json_url = 'https://www.youtube.com/oembed?url='.$url.'&format=json';
} else if ($type === 'vimeo') {
$json_url = 'https://vimeo.com/api/oembed.json?url='.$url;
}

if (!empty($json_url)) {
$curl = curl_init($json_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($curl);
curl_close($curl);
$json = json_decode($return, TRUE);

if ($type === 'youtube') {
preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match);
$json['video_id'] = $match[1];
}

return $json;
}
return NULL;
}

The hosting staff made me a patch, a temporary solution to my problem, to wait for the official release of PHP-Fusion 9.0.3 Andromeda and Addon Videos. This patch replaces only the "functions.php" file, and nothing more. The hosting staff wrote a small video caching script for me, right in Memcached. Earlier I did not have a Memcache server, it was connected in addition. Now everything is good, the speed of opening http://lightxx.ru/infusions/videos/videos.php?cat_id=1 is very fast. Photo for comparison, as it was before and now : https://postimg.cc/image/o0f1dbonf/
Yes, a memcache is fine since you are fetching a large resource every time you reload the page. As an example, Facebook utilise Memcache extensively.

PHP-Fusion direction is to bring everyone tools that cost a lot, like KendoUI replacements, formstacker, sanitizers automation, and other frameworks to encourage a subset of standardise 3rd party Addons. We believe tools, are the future of this CMS. Greater tools=High Quality Addons.

I hope people will appreciate the things we bring smile

Wow! Excellent. I made an update to the site on XAMPP, it works fast after the cache entries, very well. Previously, page cat_id = 1, on XAMPP, was loaded in 5 seconds or more. Now after writing to the cache, this same page loads 0.07600 sec. Thank you very much, Robin. Later, I will update the files on the hosting.

Chan wrote:

@Chan - We believe tools, are the future of this CMS. Greater tools=High Quality Addons.
I hope people will appreciate the things we bring smile

I wish good luck to all PHP-Fusion developers and those who contribute to this CMS. Thank you all.

zizub wrote:

Now after writing to the cache, this same page loads 0.07600 sec. Thank you very much, Robin. Later, I will update the files on the hosting.


That is the optimized speed now.

The average speed of PHP-Fusion 9 in usual performance is around 0.03sec - 0.1sec until we connect to database or other resources such as TLS and fetches data, that depends on how optimized those queries are.

It got me very curious when you hit more than 10 seconds.

All the best in your site. We are here when you need any assistance.
To zizub,

I have both memcache and OPcache enabled on my Web Host, but I run my PHP9 Site through Cloudflare now. What a difference it makes.

There are a number of benefits involved, including fast page load times, no matter where the user is, or where the webhost is. Also, there are security benefits too, including minimizing bot attacks, suspicious user agents etc. You do need to have your website running HTTPS though.

Other than that, PHP Fusion is da bomb!
Thank you ikandi for a reminder of the Cloudflare service. I already know a little about him. In the future, perhaps I will look in this direction for a more detailed study of Cloudflare.
Thread Information
Author
Replies
11 posts
Views
1,777 times
Last Post
Last updated on 1 year ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Chan, zizub, RobiNN, ikandi