Check, test and check again
I noticed today as I was about to start a different article that my website was looking a bit, well, funny. The layout was wrong, some of the colours were off, the whole thing was a mess. Don't get me wrong, it's not at the forefront of design, and won't win any beauty awards, but it looked awful!
The reason, I found, was because a lot of the assets for the styles and functionality just weren't being loaded. Couldn't be found. Vanished. I worried about the state of the server for a moment, but then realised if someone had compromised it, they wouldn't just boot off a couple of assets; they would be making a lot more serious changes. Nope, this one was user error on my part.
I recently moved servers. Same provider, better spec box. As part of that, there was obviously a migration of the setup (mostly) and it all seemed to work fine, until I moticed it today. The issue was that I was sending requests for some of the loaded assets off to a faux-CDN; basically a different subdomain of my site to let them load alongside one another. The trouble was, when I moved everything I didn't set those up, so I was effectively seeing a cached version of those files. When accessing the site from a different machine, there was no cached version to be had, and therefore the issue was all too clear to see.
This brings me to the title of the article, and how this could have been avoided. I should have gotten everything set up, checked it was working and then checked from somewhere different; or even simply clearing the browser cache to check everything was as it should be. Testing is something which does take a lot of time to do right, and if it's not done right is fairly obvious. With something as important as my own personal website, it should have been far higher on my list of things to do; but it wasn't, I messed up and I look bad for it being that way.
It's all fixed now, briefly, but I'll have the faux-CDN to reconfigure to improve load speeds.