Thanks all for the inputs and helps. I have not able to resolved this but there is a change of direction that we are to use front-end react implementation instead of optimising via backend implementation. React optimisation is also free.
Please close this question.