Hey everyone! It’s Friday, so you know that means another dev dive. As we head into the holiday season, I want to talk a little bit about one of the most important things to improve performance on the web – cache (pronounced “cash,” not “cash-ay”). Caches are actually used almost everywhere in your computer, down to your CPU. Don’t worry - I won’t get down to that level, but I do want to talk about how caching helps websites.

As amazing as the internet is, one of its main limitations is that compared to your computer, it’s slow. Even the slowest SSDs today can read data at around 500 MB/s (megabytes per second). The fastest internet connections in the US today max out at around a quarter of that, and the average internet connection is less than a tenth that fast. This means that to improve speed, your computer will avoid using the internet if it can. You may have heard of “browser cache” – when you load a website, your browser will temporarily store some of the data (such as images and JavaScript files) so that when you load the page again, it can access those files from your computer’s storage rather than having to use the internet. This makes loading the page much faster, but if for some reason those files change, your computer might still load the old version. If our Customer Success team has ever asked you to hard refresh your browser, what we’re really asking is to force the browser to ignore those cache files and re-load them from our servers again to ensure that you have the latest version of everything.

Browser caching is what’s known as “client-side” – i.e., the cached files are stored on the client (your computer). At Punchmark, we also implement “server-side” caching – cache stored (you guessed it) on the server. Many parts of our platform require getting a lot of pieces of data from different places and putting them all together – config values, item data, HTML templates, etc. This can be costly and take a lot of time. Once we have all of that data together, though, we can store it all in one place as a cache file so that the next time we need the information for that page, we can just grab the cache rather than have to go fetch the data all over again. This helps to take load off of the databases and web servers, which even further increases the speed benefits.

Let me know if you have any questions about caching or have any other topics you’d like to hear about for future dev dives!