3 ms·
As a general rule of thumb you should use as little JavaScript as possible and serve it in one big file. Just yesterday a client was wondering why his website w
by FriedrichN 6y ago
As a general rule of thumb you should use as little JavaScript as possible and serve it in one big file. Just yesterday a client was wondering why his website was slow and their webdesigners said it needed 'more varnish cache' and a bigger server.
After inspecting I saw over 100 .js files were being requested by require.js, but because each module required yet another set of .js files and those files required another set, and so on. The server was serving them up plenty fast (<50ms) but because they were being loaded in waves the load time ended up being between 5 and 7 seconds.
Many of these issues arise from being fancy and people tend to want to fix it with fancy stuff. But sometimes you need to stop being fancy and just fix the damn problem in an old fashioned way (concatenate, minify, allow local caching).
- madeofpalk 6y agoThis isnt being fancy, this is just being.... not smart (to put it charitably).
- ASalazarMX 6y agoI'd say being messy. People just want to get things done, and when they're done in a messy way, they don't want to start over. It depends on their deadlines and how much are they being compensated for doing it the right way(TM).