Hello
I know this question is very interesting
ı want to estimate website load time before deployment. ı know, there are so many parameters(server speed, internet speed etc).
But in general ı want to average time in avarage parameters. Because ı want to know my web site loading time.
is this possible?
Thanks
First, no. No valid predictions are possible in the absence of a lot of detailed information. There aren’t any “average” parameters here - at least none with any meaning.
But I’m curious, what period of time are you looking to identify? What precisely do you mean by “web site loading time”? (What are the starting and ending events defining the window you’re looking to measure?)
The closest you can get is to deploy your site to a staging server that matches the same specs as your production server. Then you can run benchmarks (the Locust tool is good) which should match your production site. But this all depends on your environment you’re in, and you also need to make sure you don’t accidentally access production data or send out emails or anything like that, from your staging server.
thanks for your answer
for example when the user first comes to the homepage the loading time and maybe the loading times of other pages and also I do some calculations on my website so I want to estimate how long it will take
Thanks for your answer, I will check it out
See, the issue with your question is that there’s no such single thing as “loading time”.
Retrieving a web page from a browser is a sequence of many steps, each with their own effects on the overall time required.
Outside of Django, in a production-quality deployment, there’s DNS resolution, TCP Socket establishment, SSL negotiation, Packet decryption, Request handling, and Request dispatch.
Then, once the request is handed off to Django, it needs to be parsed into a request
object, and passed through however-much middleware you have defined before the request even gets to the view.
Then the view needs to process that request to create the response. This processing frequently requires one or more database queries to be executed, whatever internal processing that is defined for the view, and one or more templates to be rendered.
Finally, the request gets passed back through the middleware where more processing can occur, then back to the web server for the ssl encrpytion to be performed for the return trip, and then sent out to the browser.
On top of all these individual steps, you have other factors affecting overall response time, such as the various caches that Django uses for templates and database queries, and the other requests typically made for a page for assets like static images, JavaScript, and CSS.
(The number and sizes of them can significantly affect the total time required.)
And on top of all that, you have whatever execution time may be necessary for the JavaScript running in the browser to finish the page.
The bottom line is that the only reasonably estimator is your production environment. Even a staging server isn’t necessarily going to give you a valid metric unless your staging environment is a replica of your production environment. (This includes accounting for factors such as database size and overall system activity.)