Jonniboy
Jonniboy

Reputation: 136

Separate pages vs dynamic content loading

Many web applications use some kind of dynamic content loading via jQuery or AJAX nowadays instead of just linking to new separate pages, letting the user navigate through the web page without really switching to another site. Often this kind of web technology seems to be faster, because requesting something with a smaller foot print (like JSON encoded data) is faster and therefore better for site performance.

But a lot of web projects prefer the "old styled" model: You link to another pages, if the user navigate to another page a whole HTML file is requested from the server.

What are the pros and cons for both cases? What is, in your opinion, the right way for modern web applications?

Please note that's not about static vs. dynamic pages or client-side frameworks vs. server-side frameworks or the combination of them. It's just about your perspective about this topic in general.

Thanks in advance.

Upvotes: 1

Views: 1422

Answers (2)

junkfoodjunkie
junkfoodjunkie

Reputation: 3178

You're probably gonna be shot down, since the question is a discussion more than a specific tech-question, but anyway:

Static vs. dynamic content loading - both have their place. There isn't really anything wrong with using dynamic content loading, as long as you still have a fallback in place in case users doesn't have javascript turned on, create bookmarkable links (so the content can be easily found again), doesn't load too much data (because the load-time for the dynamic content will remove any benefits if the data-load is too heavy).

Static sites are mostly cached, and as long as the content isn't too heavy (again), loading the new page isn't gonna take that much longer. What can be done more easily with dynamic content loading is that you can do preloading in the background, you can create more fancy effects (fade-ins and -outs) easily, and so on.

What you need to do is think about what the page is - is it beneficial to have simple, page-based loading (for instance a webshop or news-site), or is it a simpler site, without the need for several levels deeplinking. If it is the latter, having dynamic content loading might be a better, and quicker, way to go.

Also, there is nothing wrong with using both techniques. Using regular links and pages for main content, and using dynamic content loading for specific content that a user can manipulate. Reloading a table or list of information based on user-interaction within the site, without having to reload, might both be faster and less "jarring" for the user.

Upvotes: 1

user6909366
user6909366

Reputation:

There is a few perspectives of what you are asking of. You have a choise about getting the content from a AJAX request, OR actually navigating a client.

The log
In one way it might be annoying for a user to actually staying at the same page all the time, cause the link will not be saved in any logs OR the client will not be able to bookmark the page. For example in the chrome autocomplete function. People navigate to login pages all the time. But if there wasn't a page like example.com/login.php people would definitly be annoyed that the chrome could not make an exact navigation to it. So from this side it would be better to use an external hyper link such as example.com/login.php.

The Speed
It would go faster requesting a page with AJAX instead of the browser sending a lot of sockets to the server. So if you look at it from this perspective it would be better with AJAX

The feel of beauty
Keeping a website clean is really popular for developers, and keeping a website clean also includes the hyperlink, where extensions would not be really good. Also though URL_Rewriting would be an option. But for welcome pages AJAX is suggested instead of navigating the user to links.

Forums?
In here we get back to The Log where the point it so the user can go back into the log or store the link as an bookmark. But a forum post link might be really long and annoying that you cant find it back if you use those AJAX requests. So in this perspective it would make a user happy to be able to get the cleaner version with URL_Rewrite, which actually takes longer time then both of AJAX and normal navigating



So from my perspective I would suggest using URL_Rewriting if you are planning to have a forum or community where clients / users can post topics or other. But using AJAX requests to smaller web pages is really suggested!

Upvotes: 1

Related Questions