When a client tells us their website is slow, the first thing we check is not the code, it is the network tab, and more often than not the answer is sitting right there: a photograph straight off a phone camera, four or five megabytes, displayed at a few hundred pixels wide.
Rewriting a slow query is sometimes necessary, but it is rarely the first problem. Resizing and compressing images, and loading them only when they are about to be seen, fixes the majority of the complaints we get before anybody touches a line of backend code.
What we check first
Before any deeper work, we look at total page weight and where it is going. If it is images, the fix is cheap and fast. If it is something else, at least we know where to actually spend the effort.
