til/applied-sciences/engineering/static-vs-dynamic-sites
static-vs-dynamic-sites.mdupdated 2026-07-203419 words
ダブルクリックで英日反転
Applied Sciences · Engineering

Static vs dynamic sites — and where React or Python actually fit

EN

Every web page is delivered to the browser as HTML, CSS, and JavaScript. The real split is when that HTML is produced: a static site ships pre-built files; a dynamic site builds the HTML per request from a database. React and Python don't replace HTML/CSS/JS — they generate or drive it.

The core distinction

  • Static site: the server returns the same pre-made file for a URL — it just reads a document off disk and sends it back (MDN).
  • Dynamic site: the server builds the HTML on demand, usually by inserting database data into HTML templates, so the same URL can return different content per user (MDN).
  • Either way the browser still receives HTML/CSS/JS — the difference is who assembles it, and when.

Where React and Python fit

  • HTML/CSS/JS are the only three things a browser natively runs — that never changes.
  • React is a JavaScript library that builds the page's HTML as reusable components, either live in the browser or ahead of time at build — so complex UI isn't hand-written HTML.
  • Python usually runs on the server side of a dynamic site — talking to the database, checking logins, running business logic — then hands finished HTML or data back.

So is a dynamic site "like an SNS"?

  • Yes — social networks (X, Instagram) are the classic dynamic case: every feed is generated per user from a database.
  • A blog, a docs site, or personal notes usually don't need per-user pages, so static is enough.
  • Third path (this site): a Static Site Generator runs React once at deploy time to pre-build every page, so you keep React's authoring comfort but still ship plain static files.
HTML/CSS/JS is always the delivery. Static = pre-built files; dynamic = built per request. React and Python are tools that produce that HTML — choose static when pages don't change per user, which is most content sites.
応用科学 · エンジニアリング

静的サイトと​動的サイト — そして​ React や​ Python は​どこで​働くのか

JP

どの​Webページも​ブラウザには​HTML・CSS・JavaScript​(=画面を​作る​3つの​基本部​品)と​して​届く。​本当の​分かれ目は​「その​HTMLを​いつ作るか」。​静的サイトは​完成済みの​ファイルを​そのまま​送り、​動的サイト​(=dynamic、​アクセスの​たびに​中身を​組み立てる​サイト)は​データベース​(=データの​保管庫)から​中身を​差し込んで​HTMLを​その場で​作る。​React や​ Python は​ HTML/CSS/JS を​置き換えるのではなく、​それを​生成・操作する​道具だ。

根本の​ちがい

  • 静的サイト:ある​URLに​対し、​サーバーは​同じ​完成済みファイルを​返すだけ——ディスク上の​文書を​読んで​そのまま​送り返す​(MDN)。
  • 動的サイト:サーバーが​アクセスの​たびに​HTMLを​組み立てる。​多くは​HTMLテンプレート​(=穴​あきの​雛形)に​データベースの​中身を​差し込む方​式で、​同じ​URLでも​利用者ごとに​違う​内容を​返せる​(MDN)。
  • どちらでも​ブラウザが​受け取るのは​HTML/CSS/JS——違いは​「誰が​・いつ」​それを​組み立てるか。

React と​ Python の​出番

  • ブラウザが​そのまま​動かせるのは​HTML/CSS/JSの​3つだけ——ここは​何を​しても​変わらない。
  • React​(=リアクト、​Meta製の​JavaScript用ライブラリ)は、​画面の​HTMLを​「再利用できる​部品」と​して​組み立てる。​ブラウザ上で​その​場で、​あるいは​事前の​ビルド時に​生成し、​複雑な​UIを​手書きHTMLで​書かずに​済ませる。
  • Python​(=パイソン、​汎用プログラミング言語)は​多くの​場合、​動的サイトの​サーバー側で​働く​——データベースと​やり​取りし、​ログイン確認や​業務ロジックを​回し、​仕上げた​HTMLや​データを​返す。

では​動的サイトは​「SNSの​こと」?

  • そのとおり——SNS​(X・Instagram 等)は​動的の​典型。​フィード​(=流れてくる​投稿一覧)は​利用者ごとに​データベースから​生成される。
  • ブログ・ドキュメント・個人の​ノートは、​利用者ごとに​違う​ページを​作る​必要が​普通は​ない​——だから​静的で​十分。
  • 第三の​道​(この​サイト)​:SSG​(=Static Site Generator、​静的サイト生成器)が​公開時に​ React を​一度だけ走らせて​全ページを​先に​作り​置きする。​React で​書く​快適さを​保ったまま、​届けるのは​素の​静的ファイルだけ。
届くのは​常に​HTML/CSS/JS。​静的=作り​置きの​ファイル、​動的=アクセスごとに​生成。​React や​ Python は​その​HTMLを​作る​ための​道具に​すぎない。​利用者ごとに​ページが​変わらないなら​静的を​選ぶ——そして​コンテンツ系サイトの​大半は​それで​足りる。
148 notestil