이 블로그가 지금 어떤 구조로 돌아가는지 한 번 적어 둡니다. 나중에 다시 볼 때를 위한 메모이기도 합니다.
대부분은 그냥 파일입니다
글은 마크다운으로 쓰고, 파이썬 스크립트가 HTML 파일로 바꿉니다. 홈, 목록, 글 하나하나가 모두 미리 만들어 둔 정적 페이지입니다.
만들어진 파일은 Cloudflare Pages에 올립니다. 독자가 페이지를 열 때 서버에서 계산하는 일은 없고, 파일을 내려주는 것이 전부입니다. 이렇게 하면 빠르고, 운영할 것이 거의 없습니다.
서버 기능은 조금만
정적 파일만으로 안 되는 것이 몇 가지 있습니다. 조회 수 세기, 검색어를 벡터로 바꾸기, 검색 답변 만들기입니다. 이런 것은 Cloudflare Pages Functions로 처리합니다.
Pages Functions는 Cloudflare Workers로 서버 측 코드를 실행하는 기능입니다. 공식 문서의 표현으로는 전용 서버를 돌리지 않고도 동적인 기능을 더할 수 있습니다. 이 블로그도 서버를 따로 띄우지 않고 필요한 기능만 이 방식으로 붙였습니다.
저장하는 것
방문 통계는 Cloudflare의 D1 데이터베이스에 저장합니다. 날짜와 경로별 조회 수, 날짜별 방문자 수 같은 단순한 값만 담습니다. 검색어는 저장하지 않도록 만들었습니다.
정확히 무엇을 저장하는지는 개인정보처리방침에 적어 두었습니다.
LLM이 끼는 곳
검색 답변 같은 일부 기능에는 LLM이 쓰입니다. 어디에 어떻게 쓰는지는 AI 활용방침에 따로 정리했습니다.
왜 이렇게
이 구조에서 글은 파일이고, 필요한 기능만 작은 함수로 붙습니다. 상시로 돌리는 서버가 없어서 관리할 것이 적다는 점이 장점입니다.
구조가 바뀌면 이 메모도 고칩니다.
I'm writing down how this blog is structured right now. It's also a note for when I look at it later.
Most things are just files
Posts are written in Markdown, and a Python script converts them into HTML files. The home page, list pages, and individual posts are all pre-built static pages.
The generated files are uploaded to Cloudflare Pages. When a reader opens a page, there is no server-side computation; it simply serves the files. This makes it fast and requires almost nothing to operate.
Only a little server functionality
There are a few things that static files alone cannot do. Counting views, converting search queries into vectors, and generating search answers. These are handled with Cloudflare Pages Functions.
Pages Functions is a feature that runs server-side code with Cloudflare Workers. As the official documentation puts it, you can add dynamic functionality without running a dedicated server. This blog also attaches only the necessary features in this way, without spinning up a separate server.
What is stored
Visit statistics are stored in Cloudflare's D1 database. It only holds simple values like view counts by date and path, and visitor counts by date. Search queries are not stored.
Exactly what is stored is written in the Privacy Policy.
Where LLMs come in
LLMs are used for some features like search answers. Where and how they are used is detailed separately in the AI Usage Policy.
Why this way
In this structure, posts are files, and only necessary features are attached as small functions. The advantage is that there is less to manage because there is no server running all the time.
If the structure changes, I'll update this note too.