Optimization doubt

Asked

Viewed 48 times

0

Talk, you guys, baby ?

I have one question... I am making a system that contains several screens , and I am organizing as follows , I created a single index for the main page, and this index has all the contents of the screens , my forms , logically organized within the standards of HTML5. And for every screen I have a file .js. My doubt is , to group all that content from within a singleindex html impairs the rendering and optimization of my system ?

Thank you!

  • 2

    Not necessarily. If normally the application will be accessed by those who use multiple screens, I see no problem. The problem of carrying something extra is evident on a website accessed by a large number of people. If it’s a system used in a 200-person environment, the extra charge won’t make a significant difference. And there’s the cache! Better to prioritize organization than separation in such a case. The question is, what would be the gain by putting it all together? What you need to do is put the benefits of each option in the balance. Just from what was described in the question, there is no answer "single and certain".

2 answers

3


I will try to supplement a little the other answer.

Yes, you may end up impairing performance, but it is worth taking into consideration the type of page/app you are creating.

If it is a simple page that can be used on mobile devices (3G or 4G) the weight is of utmost importance, since the app may be running on a network of low speed, high latency and even possibly on a device with few ram resources, etc.

So, letting your page be heavy will certainly hurt the experience in these cases, but if it’s a page to be used primarily (or exclusively) on desktops (e.g., a web system) where people tend to stay long online in the tool, it is worth taking a little longer to load in the opening and then have a smooth experience during use.

Things to take into account: 1) The more separate files, the greater the chance of multiple requests being sent to your server which, with high latency, will cause slow loading. With http/2 this may become irrelevant. 2) The bigger your files, the longer it will take to load, but if you set the headers correctly for caching, you will have users downloading the file only once and then receiving the 304 as return (not modified / unmodified). This will help a lot the next times the user enters the page 3) Even if you choose to leave everything in a single file, take a look at the "weight" of your site (in kb) and try to take into account the profile of people you will use. If they are mostly fixed broadband, a site of 1mb is not so bad, but if it is cellular, it is very complicated.

I hope I’ve helped =)

  • Thank you very much. Gave a very good clarification.. It is a Web system for desktop, although it is responsive. But the reason I have put all the system content in a single html is precisely the user experience, because the system gets more usual and avoid those refrehs on the screen. So I was a little afraid to put it all together.

0

Uploading all components and scripts into a file can only greatly impair the performance of your site to the client, since for each request it will have to download all the content of the entire application and not only the specific content of the page. In that link has some web performance tips.

  • Got it. I’m gonna read it. Thanks

Browser other questions tagged

You are not signed in. Login or sign up in order to post.