Trevor McCormick

Building a Self-Monitoring Website with PageSpeed Insights and AWS

Your website’s performance matters. Google uses it as a ranking signal. Users abandon slow sites. But monitoring performance continuously is tedious and easy to forget.

So I built a system that monitors itself. Every week, it checks its own PageSpeed Insights score, stores the results, and displays them right here on this page. Total cost: about $0.50 monthly. Setup time: one afternoon.

Here’s how it worksβ€”and how you can build the same thing.

Keep it Simple

This website is basically a set of static files on S3, served through Cloudfront.

How This Site Works: The Network Journey

Bob types trmccormick.com into his browser.

DNS Resolution: The Address Lookup

Bob’s browser doesn’t know what trmccormick.com is; it needs to map that website to an IP address.

First, it checks its local DNS cache. That’s the in-memory mapping table Bob’s browser holds on to so it doesn’t have to make redundant DNS queries for websites he has visited before. It only holds on to websites he has visited in his current browsing session.

Buildspec for Hugo Extended on Amazon Linux 2

Are you frustrated that your Hugo website builds are not reflecting your local changes? If you’re using scss files to manage your website styling, and the changes you make locally are not showing up on web server, then you might be facing challenges installing Hugo Extended.

Here are some common errors you might see in AWS CloudWatch:

1
2
hugo: /lib64/libm.so.6: version 'GLIBC_2.29' not found (required by hugo)
hugo: /lib64/libstdc++.so.6: version 'GLIBCXX_3.4.26' not found (required by hugo)
1
tpl/internal/go_templates/texttemplate/helper.go:11:2: package io/fs is not in GOROOT (/root/.goenv/versions/1.14.12/src/io/fs)

To resolve these errors, you need to do three things within your buildspec: