Asked by:
How do i improve ttfb for my website

Question
-
User2041008840 posted
Hello,
I develop the web app on asp.net core mvc and the database is huge on it.
So i checked in inspector of browser so the first touch on website browser is taking so long time.
My website is optimize but its load data before showing to client. Its fetch almost almost 500 rows from table.
So how do i show speed up ttfb.
Or how do i cache query results ?
Please help me I didn't find proper solution for it.
Thank you,
PrathameshMonday, March 9, 2020 5:57 AM
All replies
-
User303363814 posted
The first thing is to work out what is taking a long time. Is the problem only for the first person who touches the web site? Web server process startup can be slow if you are using shared hosting. Is it only slow for the first database access? WHere is the database? This node or another? Again, database startup time can be slow.
Or is the problem for everyone everytime? Are the rows the same everytime? Can you hardcode the data rather than fetching? Do you have correct indexes on the table? WHat does the query optimiser show you?
There is never a magic 'go faster' button. You have to measure so that you know what is the bottleneck (DON'T guess, you will guess wrong).
Monday, March 9, 2020 12:15 PM -
User753101303 posted
Hi,
For example you have tools such as https://developers.google.com/web/tools/lighthouse
Assuming the HTML for the page is quite big, a common change is to not show all rows upfront but to provide a filtering and/or paging UI so that the app can show the user what he wants to seee and 50 rows for example at a time...
Monday, March 9, 2020 12:32 PM -
User932909087 posted
Hi Prathamesh,
There are many things to increase your website speed, such as disable session state, turn off tracing, etc. Please refer to this post https://windowswebhostingreview.com/asp-net-hosting-tips-how-to-increase-your-asp-net-performance-for-seo/. You can also read many tutorial in google.
Tuesday, March 10, 2020 8:34 AM -
User711641945 posted
Hi Prathamesh,
Or how do i cache query results ?It seems you could use distributed caching in ASP.NET Core.
Reference:
https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-2.2
Best Regards,
Rena
Tuesday, March 10, 2020 9:08 AM -
User2041008840 posted
I checked data fetching takes time,
my hosting is shared hosting, the other css and js are load fast its almost take
1ms time, but data fetching takes 1.2seconds to load and show into html table format. I have correct index its and use clusterd and non clustered index by getting result on execution plan result. I made changes to opimize table.
What do you think where is exact issue is it with Hosting ? or something else ?
Tuesday, March 10, 2020 4:17 PM -
User753101303 posted
What is the size of your HTML page ? When showing too many rows most of the time is spent in downloading and rendering the HTML markup rather than really on server side operations.
Tuesday, March 10, 2020 5:34 PM -
User2041008840 posted
its 1.8mb size of html page its showing almost 5000 rows in table.
I also applyied paging and search for it. I am using bootstrap-tables js it does all searching, paging and ordering.
Wednesday, March 11, 2020 4:58 AM -
User711641945 posted
Hi Prathamesh,
There are several results causing the website's performance so slow.For example:
1.downloading the data from website is slow;
2.Redering the view is slow;
3.The code backend makes the website slow.
For the backend performance,you could try the following code to check which method waste too much time and then you could share the code to us.We would help you how to improve it.
https://stackoverflow.com/a/55688977/11398810
Best Regards,
Rena
Friday, March 13, 2020 7:23 AM