Hi!
I use jsForAPI for jQuery-based AJAX call:
apiAJAXCall :: Text
apiAJAXCall = jsForAPI api' jquery
where api' is an API from one single endpoint. After that I embed this text into <script>-tag in the index page (it's important detail, see below).
It works perfectly, but I see that the first request is too slow: TTFB is ~500 ms (on localhost!). Important: it's not AJAX-request for this endpoint, it's a request to index page! Such a big delay occurs only for the first request to the index page (after app reload), all other requests are very fast. How can I fix it?
Hi!
I use
jsForAPIfor jQuery-based AJAX call:where
api'is an API from one single endpoint. After that I embed this text into<script>-tag in the index page (it's important detail, see below).It works perfectly, but I see that the first request is too slow: TTFB is ~500 ms (on
localhost!). Important: it's not AJAX-request for this endpoint, it's a request to index page! Such a big delay occurs only for the first request to the index page (after app reload), all other requests are very fast. How can I fix it?