How to add a loading page, some like Gmail?

My server is KVM vps, RAM 4gb free 1.3gb, BW is 100mbpe

https://meta.discourse.org/t/home-index-taking-to-long-to-load/20026

https://meta.discourse.org/t/my-site-page-load-slow-i-have-no-idea/20947/

https://meta.discourse.org/t/just-curious-why-emberjs-and-handlebars-libs-are-used-what-do-they-do-so-special-behind-the-scenes/18466/