In an angularJS app there is quite a big of latency between the user and the server (also bandwidth may be limited), so when the user requests a new page, it has to wait about 2-500ms for it to load.
I'm thinking of "preloading" model data, templates, scripts in the background, but intend to do so ONLY if there is no page requested by the user. If the user requests one specific page I'd like to stop the preloading process and load the resources explicitly requested by the user.
So my question boils down to:
- Is there a way to make an ajax request "ONLY IF" there is no network activity?
- Is there a way to "pause" currently running ajax requests? or
- Is there a way to prioritize ajax requests?
Thanks,