Are SPAs (Single Page Applications) suitable for sites aimed for mobiles?

前端 未结 8 1199
野趣味
野趣味 2021-01-31 03:27

I am planning to create a website with around different 20 views/pages primary for mobile phones.

If I want to focus on a making the user experience very responsive (as

8条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-31 03:55

    The turning point for this decision is the complexity of the development. Regular web-server based apps, are easier to develop because there are much more developers out there who know all the tricks how to make such application to perform at maximum effectiveness. SPAs on the other hand can achieve better performance in all areas 1) faster data transfer, 2) faster GUI(DOM) operations, 3) smarter UX, but all of those will require more experienced(expensive) developers who can make it fast and reliable. Those devs are fewer. If you plan to do everything yourself it means longer learning curve for you and a lot fo trial/error. This is mostly because SPAs are new compared to regular WWW.

    To make an effective SPA you need to know the connection/socket part very well, know the bottlenecks, how protocols are chosen, what platforms (devices) support which connection protocols. Just choosing your preferred solution is not easy: Engine,IO, Socket.IO, SockJS and others.

    You will need to know DOM manipulation very well in terms of dynamic performance, to wisely choose between divs/tables/canvas.

    You will need to effectively use browser side abilities to store data, i.e. cookies, cache, local data storage facilities (files/db) to store data during the session and between the sessions.

    JavaScript these days is very fast on iOS/Android, so the speed of language itself should be not a problem anyway. The great advantage is to use Node.js so that you can program in the same language both client and server sides. No need to sync hashThisPassword() functions across two (or more) languages.

提交回复
热议问题