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.
dliu-com in eu-west-1 (Ireland)The CloudFront certificate is issued in us-east-1, as CloudFront requires; everything else is in eu-west-1.
- Pages.
src/index.html,src/404.htmlandsrc/docs.html, plussrc/style.cssfor the landing page's layout. The header, footer, cards and colours come from the shared dliu.com stylesheets onfiles.dliu.com, so every dliu.com site looks the same. - Clean URLs. A viewer-request CloudFront Function serves
/fromindex.html,/docsfromdocs.html, and redirects the old/docs/healthto/docs#health(301). Missing files return the 404 page. - Visitor statistics. A shared viewer-response function sets the anonymous
dl_vidvisitor cookie, and CloudFront's access logs feed traffic.dliu.com. - Résumé. Written in LaTeX (
resume/resume.tex) and built with Tectonic bymake resumeintosrc/resume.pdf, which is served at /resume.pdf. - DNS. The
dliu.comhosted zone belongs to the shared core infrastructure. This stack only adds the apex A and AAAA alias records.
Caching
| Files | Browser | CloudFront edge |
|---|---|---|
| HTML pages | No Cache-Control header | Default caching, up to 1 day |
style.css, resume.pdf | 5 minutes | 1 day (s-maxage=86400, stale-while-revalidate=86400) |
| Shared stylesheets and icon | Cached by files.dliu.com | |
- Every deploy invalidates
/*once, so changes show at the edge straight away. A browser may keep the old stylesheet or résumé for up to 5 minutes. - Automatic clearing on S3 changes is not used: the bucket only changes through deploys, which already clear the whole cache.
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
- The S3 bucket blocks all public access. CloudFront reads it through an origin access identity, so files are only reachable through
https://dliu.com. - HTTP requests are redirected to HTTPS. Only
GETandHEADare allowed. - There is no sign-in, form, API or JavaScript, and the site stores nothing about visitors apart from the anonymous visitor cookie used for traffic statistics.
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.
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.
What is checked
| Function | What it does for you | How it’s tested | If it stopped working |
|---|---|---|---|
| Pages | Shows the home page and the docs | Opens 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 addresses | Follows the old /docs/health link; visits a page that doesn’t exist | ✗ Old links break, or a bare error appears |
| Secure connection | Moves visitors to the secure (padlock) site | Visits 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.
What isn’t tested
- Nothing on dliu.com needs signing in, so no signed-in actions are left out.
- Publishing updates to the site, which the owner does from his own computer.
- The visitor statistics; the checker’s own visits are left out of them.
Technical version for machines (Markdown)
Source: dliu-com/dliu-com