Fork me on GitHub
#fulcro
<
2022-01-29
>
Timofey Sitnikov14:01:48

Good Morning all. I am trying to reduce loading times of the https://github.com/fulcrologic/fulcro-template . Below is the network time. Why does remote-relay and api take so long? How can I reduce the loading of the remote-relay and the api

tony.kay18:01:24

Fulcro really has very little to do with that. remote relay is shadow, I think. The API is just hitting your resolvers/code through Ring.

Timofey Sitnikov18:01:44

@U0CKQ19AQ, OK, thank you, I will ask in the shadow-cljs channel. As far as the API, is it in the file src/main/app/server_components/middleware.clj ? In the

(defstate middleware
  :start
  (let [defaults-config (:ring.middleware/defaults-config config)
        legal-origins   (get config :legal-origins #{"localhost"})]
    (-> not-found-handler
      (wrap-api "/api")
      wrap-transit-params
      wrap-transit-response
      (wrap-html-routes)
      ;; If you want to set something like session store, you'd do it against
      ;; the defaults-config here (which comes from an EDN file, so it can't have
      ;; code initialized).
      ;; E.g. (wrap-defaults (assoc-in defaults-config [:session :store] (my-store)))
      (wrap-defaults defaults-config))))