r/Clojurescript • u/monstasat • Aug 31 '16
Too much requests prevents user to interact with the site
Hi! I am currently developing a frontend in cljs. The site should display a lot of statistics to the user, the statistics is fetched from the backend. For example, now I have 120 requests to backend when the site is refreshed/initially loaded. Each request takes at about 1-2 sec to be handled by the server. The problem is that while these requests are handled, all other site functionality is not available (because it needs other requests to be handled by the server). How this problem could be solved? Is there any way to set priority to the request?
I am using cljs-ajax to communicate with the Immutant web server. The project itself is based on the Luminus framework.
Thanks in advance!
1
u/ryno55 Aug 31 '16
Reduce your requests, do it all in one (or a few) requests to the server side, and have the server proxy any other requests you need to make
1
u/sarcasmguy1 Aug 31 '16
You definitely need to reduce your requests. 120 on initial load is quite heavy. What is it requesting?