I have a web app that is heavily loaded in javascript and css. First time users log in it takes some time to load once it is downloading js etc. Then the caching will make everything faster.
I want my users to be aware of this loading time. How can I add some code to ‘show’ some loading information while js and css are downloaded?
You could show an overlay saying ‘loading…’ and hide this the moment the downloads are complete.
Contents of clear-load.js:
Of course, you could also tack the javascript code that hides the div at the bottom of the last javascript file that’s loaded.
Also, try to pack your javascript and css files into one file and apply gzip compression or ‘minify’ to them. You can bring 500KB of javascript in 20 requests to 1 request of less than 100KB if you do it right.