Dewei Liu

How it works

dliu.com is a static site: a landing page, a 404 page, the docs pages and the résumé PDF. The files sit in a private S3 bucket and CloudFront delivers them. There are no servers, no database and no JavaScript.

0 serversonly static files
0 JavaScriptHTML and the shared CSS only
All edge locationsCloudFront, HTTP/2 and HTTP/3
1 CDK stackdliu-com in eu-west-1 (Ireland)
Request path
1Browserhttps://dliu.com
2Route 53 + CloudFrontHTTPS, certificate from ACM
3CloudFront Functionsclean URLs; visitor tag
4Private S3 bucketread only by CloudFront

The CloudFront certificate is issued in us-east-1, as CloudFront requires; everything else is in eu-west-1.

Caching

FilesBrowserCloudFront edge
HTML pagesNo Cache-Control headerDefault caching, up to 1 day
style.css, resume.pdf5 minutes1 day (s-maxage=86400, stale-while-revalidate=86400)
Shared stylesheets and iconCached by files.dliu.com

Deployment

The site is an AWS CDK app in cdk/. Deploys run locally from a machine with AWS credentials; there is no CI pipeline.

make install   # npm ci in cdk/
make test      # Jest: stack template and shared-look checks
make resume    # rebuild src/resume.pdf (only after résumé edits)
make deploy    # cdk deploy dliu-com

The deploy uploads src/ to the bucket in two steps: non-HTML files with the cache headers above, then the HTML files. Both invalidate the CloudFront cache.

Cost

Everything is billed per use, and at this site's traffic it stays inside the AWS free tiers: S3 storage for a few files, CloudFront requests and data transfer, and CloudFront Function invocations. The ACM certificate is free. The Route 53 hosted zone is shared with the other dliu.com sites.

Security

How dliu.com is tested

Live status: status.dliu.com/site/dliu
Machine-readable version: /docs/health.md

Every 15 minutes, status.dliu.com visits dliu.com from Ireland, Virginia and Tokyo like an ordinary visitor, without signing in, and checks that each part of the site works. Once an hour it also opens the home page from inside mainland China. The checks only look; they never change anything.

4 functions testedevery part a visitor uses
8 checksin every test run
Every 15 minutesfrom Ireland, Virginia and Tokyo
0 sign-ins neededtested as a guest
Who tests what
GuestTesters
status.dliu.comIreland, Virginia, Tokyo every 15 min
Mainland Chinahome page, once an hour
EdgeWhat visitors open
CloudFronthome page, docs and résumé, over a secure connection
CloudFront Functionsshort links and the friendly not-found page
PrivateStorage
Private S3 bucketthe pages and the résumé; only CloudFront can read it

There is no server tier: dliu.com is just files, with no server or database behind it, so checking what visitors open covers the whole site.

Every run ends with one of three results
Workingevery answer right, within 3 seconds
Slowright but slow, missed once, or missed from one place only
Not workingmissed in two runs in a row (about 30 minutes)

What is checked

FunctionWhat it does for youHow it’s testedIf it stopped working
PagesShows the home page and the docsOpens the home page, /docs, the styling and /docs/health.md✗ An error instead of dliu.com
RésuméShows the résuméOpens /resume.pdf✗ The Résumé link gives an error
Short links and “page not found”Sends old links to the right place; friendly page for wrong addressesFollows the old /docs/health link; visits a page that doesn’t exist✗ Old links break, or a bare error appears
Secure connectionMoves visitors to the secure (padlock) siteVisits dliu.com without the padlock✗ Old non-secure links stop working

✓ Every function working means dliu.com is up. If Pages stop working, it counts as down; if anything else does, it counts as partly working.

Checks per function
Pages4 Résumé1 Short links2 Secure link1

What isn’t tested

Technical version for machines (Markdown)

Source: dliu-com/dliu-com