This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

rajakhoury
rajakhoury

Hi, According to Google PSI my server response time is slow (always around 1.2 s ). I would like to know how to measure my server response time properly in a OctoberCMS / Laravel app. I understand this can be improved with caching and good code logic but i need some way to be able to track progress, DB queries times, response time ect..

Can someone guide through this ?

Thanks.

Last updated

rajakhoury
rajakhoury

I end up doing microtime(true) - LARAVEL_START ; in my component response. I can clearly see that problem is from my DB queries, without any query it does down to 0.3

DMeganoski
DMeganoski

Just a suggestion... October is based off of Laravel, so a lot of the Laravel packages work with October.

Try Laravel Debug Bar (https://github.com/barryvdh/laravel-debugbar) It provides quite a few useful tools for debugging, including the queries ran and execution time of each.

rajakhoury
rajakhoury

Thank you for pointing out this Package.

Indeed the problem was from Database queries, when I added the Cache::remember in my model scopes and caching for route responses the speed increased but not there yet. I am dealing with tabular data ( tables with +20K records and 3-4 different queries per page) .

Just a quick question, if you had to minify your HTML what is the best way to do it without performance cost ? Using custom twig filters or JS like gulp,grunt

I will have a look at lavarel-debugar and thanks for your patience

DMeganoski
DMeganoski

Sorry, I'm still a fairly fresh developer myself, and just started with October (though I've worked with Laravel for some time). I'm not sure exactly what you mean. Do you aim to reduce the size of your html on your pages? Typically, using javascript to generate html is much faster than php. May not be a bad idea to render your table with javascript from a set of json data.

Are you loading all of the data into one table when the page loads? Perhaps you should consider paging the table and using php to do the server side processing such as paging and sorting.

DataTables.js is a life saver when it comes to these types of things. By default, it just pages an existing table, but it also has options to use server-side processing. Perhaps this will help you as well.

rajakhoury
rajakhoury

Thanks mate. well noted!

1-6 of 6

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.