I am trying to get rid of JS from my store to make it work at best without JS at all, because it takes a lot of time to process all JS logic and in my country we still using 2G networks and as a result the website is really slow.

I have found a lot of statements like

data-bind="text: new String('Welcome, %1!').replace('%1', customer().fullname)"

First of all I don't understand the purpose of such binding, this data won't change.

Is there any way to disable this completely, and use server side data load.



KnockoutJS in Magento 2 deals with dynamic display of UI components I do not think this is the best way to optimize.

Magento 2 uses the Knockout.js framework to dynamically build some parts of it's frontend. It provides a great way to create interactive frontend data bound components within your Magento 2 store. Knockout.js eases working with dynamic javascript user interfaces by making use of the Model-View-ViewModel (MVVM) pattern.

Features of Knockout.js

  • Observables and dependency tracking
  • Declarative bindings
  • Templating

But if you still want to do this, this is crazy, you may have a gap with Checkout. It is better to look for optimization work in custom modules. Maximum compression, css, custom javascript in a customizable theme.

  • Thank you for you response, so basically there is no easy way to disable ajax requests and output data directly ? Jun 24 '18 at 21:18
  • @solderingiron This is not ajax it's KnockoutJS. There's no easy way. This is part of Magento 2. This is the same if a person has to replace veins. Sorry for the comparison. Jun 24 '18 at 21:34
  • Thx, there is nothing impossible, could you just edit your answer explaining what is the purpose of using Knockout JS in Magento ? there is no highly dynamic UI that should be synchronized ... Jun 24 '18 at 21:47
  • @solderingiron Yes , I could) Jun 24 '18 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.